[personal profile] finesoul


I had a zip code as int and needed it as 4 chars length string with leading zeros.
That's a simplified example how it was done.

select top 5 
  IDStr = RIGHT(REPLICATE('0',4)+CONVERT(varchar(4),tt.ID),4), 
  IDInt = tt.ID
from Publication tt

IDStr IDInt
----- -----------
0001  1
0002  2
0003  3
0004  4
0005  5

(5 row(s) affected)

Лютий 2022

Н П В С Ч П С
  12345
6789101112
13141516171819
202122232425 26
2728     

За стиль дякую

Створено з Dreamwidth Studios
Сторінка створена 2026-Лют-13, П'ятниця 00:47