Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 001 + 1 = 002 (and not "2")

Author  Topic 

Gingis
Starting Member

6 Posts

Posted - 2001-05-17 : 14:51:22
Hi,

I am trying to increment a number which looks like "001", "002", "123", "456"..

The problem : The zero(s) always disappear when they are at hte beginning of the string.
003 + 1 becomes 4 instead of 004

Quick example in the query analyser :
SELECT test=001+1 FROM sampletable

results in "2" instead of "002"

Does anybody have and idea ?

Thanks

   

- Advertisement -