Skip to Content
0
Former Member
Feb 23, 2010 at 11:50 AM

logic for next number

122 Views

I am maintaining a number sequence in the ztable ie 4 digitis ie from

0001 to 9999 along with time and date.

And i am using the select single max query to get the next number and after getting then updating that number in the end of the program.

we wont maintain the numbers in sequence, user will maintain by table maintainance, it depends on user. where ever there is a blank that number we need to use.

For example

0001

0002

0003

0005

0020

9999

in the above case after reaching 9999 it need to go to 0004 and after that goto 0006 etc.

please tell how to do