Converting Dates from a txt file

J

John Zellman

I'm attmepting to convert a date/time field in a txt file
to access with a date only.

For example "2004/1/1 12:00AM" in the text file should
be "1/1/04" in Access.

Any suggestions?

Thanks
 
D

Douglas J. Steele

CDate("2004/1/1 12:00AM") should work just fine, regardless of what Short
Date format have been selected on the workstation.

If any of the date/time fields have a time other than 12:00AM and you want
the date only, try

DateValue(CDate("2004/1/1 12:00AM"))
 

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