Convert dates

elsanto

Aspiring to Sainthood...
Local time
Today, 15:16
Joined
Jul 9, 2003
Messages
35
Howdy all,

I have a bunch of xls sheets linked to an Access db.
The xls sheets have a Sent field, containing date/time in format dd/mm/yy hh:nn
There is a table in the Access db called Appended containing a field called Received.

I need to get the difference. Problem is Access seems to read the two fields (Sent and Received) as different formats. Consequently, I just get an #ERROR.
Can I code it so it converts whatever is the Sent and Received fields to the same format to give my difference?
Many thanks.
 
Have you used the CDate() function to convert both fields to dates?
 
Nope. What should the code look like? Not sure how to use this.
 
Once the data is in, you should be able to use a query to return the recordset you have

i.e. as a new field

NewName: CDate([FieldName])
 
Oh yeah. That did it. If I ever run into a black-haired albino wearing an inverted KFC bucket on his head, I'll throw money.
Thanks!
 
You could also use the IsDate() function for evaluation purposes before using the CDate() to test whether it will be convertible...just in case.


Throw me a chicken wing instead. :rolleyes:
 
CDate is perfect, but thanks. I'll check it out.

*throws chicken wing*

There'ya go.
 

Users who are viewing this thread

Back
Top Bottom