|
-
Jun 2nd, 2006, 08:23 AM
#1
[RESOLVED] max number
Hi i am having a field empno as nvarchar that starts like "IF002"
I want to auto increment this while i insert each time a record by vbcode
-
Jun 2nd, 2006, 08:32 AM
#2
Re: max number
if the field follows the same structure.. meaning
IF001
IF002
IF003
etc..
using MAX will work to get it
SELECT MAX(empno) etc....
then just cut and add
tmp = rs.fields(0)
tmp = left(tmp,2) & (Format(Cint(right(tmp,3))+1,"00#")
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 2nd, 2006, 08:37 AM
#3
Re: max number
The order will be
IF001
IF002........IFXXXX
Will it work for Nvarchar in MSSqlserver
-
Jun 2nd, 2006, 08:52 AM
#4
Re: max number
it works in access with text which is basically the same thing...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Jun 2nd, 2006, 08:54 AM
#5
Re: max number
Thanks Static , I check and come back
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|