View Full Version : Digit


accessman2
01-08-2007, 06:26 PM
In the table,

Can we setup the format in the field?

I want to setup 0000, four digits, int datatype.

the user just input 1, 2, or...etc.

then it will show like this in the table.
0001
0002
.....

Can we do that?

Ron_dK
01-09-2007, 12:02 AM
Set the data type of the field to Number > field size : long integer and format > 0000


Btw why is this thread posted in SQL server, shouldn't it be in General .

Pauldohert
01-09-2007, 03:34 AM
Btw why is this thread posted in SQL server, shouldn't it be in General .

Have I missed something - I assume he has a SQL server table?

pdx_man
01-09-2007, 04:04 PM
Declare @tr Int
Set @tr = 4
Select Replicate('0',4-LEN(@tr)) + CONVERT(VARCHAR,@tr)