Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto increment the last digit in a returned value

Status
Not open for further replies.

frogjumps

IS-IT--Management
Aug 10, 2001
14
US
i need to auto increment the last digit in the returned value of the following, how do I do this, and it needs to be reset daily. is this even possible?

<code snip>
<%

Dim sRMAstring
Dim sTDate
Dim sRMAnum
Dim iLastRMA
Dim sRuser
Dim sUser
Dim vDate

'** Todays Date in this format (ie 012202 NOT 01/22/02)

vDate = Date()

vMonth = Month(vDate)

if len(vMonth) < 2 then vMonth = &quot;0&quot; & vMonth

vDay = Day(vDate)
if len(vDay) < 2 then vDay = &quot;0&quot; & vDay

vYear = Right(Year(vDate), 2)

sTDate = vMonth & vDay & vYear


'** get iLastRMA from the database
sRMAnum = rsRMAEntry.Fields.Item(&quot;RMAnum&quot;).Value
iLastRMA = Left(sRMAnum, 9)

'** request & format sRuser from server

sUser = Request.ServerVariables(&quot;REMOTE_USER&quot;)
sUser = mid(sUser, 5)

sRuser = sUser

'*** the finished RMA # in string format

sRMAstring = sTDate & Left(sRuser,1) & Right(sRuser,1) & CStr(CInt(iLastRMA + 1))
%>
 
what are you trying to increment? what field? I'm failing to follow it. Sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top