Text to Date(MM/DD/YY) Conversion

J

Jayshreeb

In my Access database, I have one "TEXT" field which
contains date in "mm/dd/yy" format & now
1> I want to convert the Text data in actual Date
(MM/DD/YY) format
2> I want to find the difference between the two dates
Thanks
Jayshree
 
D

Douglas J. Steele

You should be able to use the CDate function to convert the text date to a
real date. If that fails, you can parse the date into the year, month and
day and use DateSerial to convert it: DateSerial(Mid(TextDate, 7),
Left(TextDate, 2), Mid(TextDate, 4, 2))

Once you've got them as dates, you can use DateDiff to compare them.
 
J

Jayshree

Thanks for great help, it works
thanks again
-----Original Message-----
You should be able to use the CDate function to convert the text date to a
real date. If that fails, you can parse the date into the year, month and
day and use DateSerial to convert it: DateSerial(Mid (TextDate, 7),
Left(TextDate, 2), Mid(TextDate, 4, 2))

Once you've got them as dates, you can use DateDiff to compare them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)






.
 

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

Top