Text to Date

J

Jeremy Noland

Anyone know of an easier way to convert a 4-length string
to a beginning date (in my case 06/01/(XXXX-1) ) and
ending date (in my case 05/31/XXXX). XXXX Is ALWAYS 4-
length, it IS TEXT, and is in the range of 2000-2400.

My way is a lengthy VB module (switch on characterN of
XXXX - convert to number and insert in static date field
06/01/XXXX). I do not know if it works yet, checking to
see if anyone here knows better!

Thanks in advance,
Jeremy
 
B

Bruce M. Thompson

Anyone know of an easier way to convert a 4-length string
to a beginning date (in my case 06/01/(XXXX-1) ) and
ending date (in my case 05/31/XXXX). XXXX Is ALWAYS 4-
length, it IS TEXT, and is in the range of 2000-2400.

My way is a lengthy VB module (switch on characterN of
XXXX - convert to number and insert in static date field
06/01/XXXX). I do not know if it works yet, checking to
see if anyone here knows better!

Try:

Beginning Date: CDate(CStr("6/1/" & (XXXX-1)))
Ending Date: CDate(CStr("05/31/" & XXXX))
 
Top