4 replies
by streamlogic
LWwiliiams,
In MS Access, you can use very similar functions to VBScript. These are much different that what you will find on SQL Server.
If the numbers will always be in the same format, you can try:
SELECT Replace("R06081213",Mid("R06081213",4,2),"09") AS Expr1;
Replace() finds data in a string and replaces it/
Mid() selects data in the middle of a string from a starting point, and length.
For changing the year, you can use LEFT() and RIGHT() rather than MID()to search from the left or right of the string.
Hope this helps,
Curtis
Curtis Hughes
StreamLogic Inc.
http://www.StreamLogicInc.com
by ewingdweller
Continuing the previous answer, you may need to use a function similar to the following:
SELECT Replace("R06081213",Mid("R06081213",4,2),"090001") AS Expr1;
Based on your question, you probably need a more robust function using FOR/NEXT looping. Seems like you could just do something similar to the following psuedo code:
rst.Reports = SetRecordsetFilter()
[note: see Access Help for instructions
on that!]
For i = 1 to rst.RecordCount
origName=[ReportNm];
[ReportNm] = Left(origName,4) & (9000+i);
next;
by ewingdweller
Oops.
The first function would be
SELECT Replace("R06081213",Mid("R06081213",4,6),"090001") AS Expr1;
by lwwilliams
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending