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)
 Substring query question

Author  Topic 

slave_zero69
Starting Member

4 Posts

Posted - 2004-12-17 : 01:50:08
hello people,

im using this to retrieve a database item:
select MAX(substring(debitnote, 6, 4)) + 1
from paymdebitnote

the debitnote is in format 2100/0001
what i want to retrieve is the 0001 part and then add 1 to it
which makes it 0002 but i always get a returned result of 2
can anyone suggest to me any particular SQL function that i can make use of?

your help is much appreciated!

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2004-12-17 : 04:10:40
you can just add the 0's using replicate

--------------------
keeping it simple...
Go to Top of Page

slave_zero69
Starting Member

4 Posts

Posted - 2004-12-28 : 02:52:16
thanks dude
Go to Top of Page
   

- Advertisement -