Text to Date

  • Thread starter Thread starter Jeremy Noland
  • Start date Start 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
 
Hi Jeremy,

Were you looking for DateSerial?

DateSerial(year, month, day)
 
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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top