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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Find or RIGHT/MID/LEFT function ?

Status
Not open for further replies.

Mizzness

Programmer
May 2, 2003
174
US
All.

I have a set of data in date format (mm/dd/yyyy).
I need the macro to find "19" & replace it with "20". Simple enough except "19" shows up in the dd section.
In short, I need to change all of the data in years only from 19 to 20 while leaving the day portion alone.

Control/Find changes all data that is 19 to 20. Can the RIGHT, LEFT or MID function be combined or used alone ?
I'm not sure how to write this bit of code.

Any & all help is appreciated.
 




Hi,

You really do not need to use STRING functions. Dates are NUMBERS. faq68-5827

If the YEAR is less than 2000 then assign DateSerial(year(YourDate)+100, Month(YourDate), Day(YourDate))

Skip,
[sub]
[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue][/sub]
 
I'd opt for RegEx depending on how the data is stored (if it's inbedded in a string regex, if we're talking a table then this is another story)

Never knock on Death's door: ring the bell and run away! Death really hates that!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top