CDate function

camg12

Registered User.
Local time
Today, 14:39
Joined
Jan 5, 2010
Messages
18
I'm using the CDate function to convert a timestamp into a date but it isn't working completely. I want it to be a ten digit date for example 01/05/2010. The problem if the date is less than nine, 1/5/2010, it isn't returning a value.

Date: CDate(Left([TSMP],10))

Examples:
TSMP / Date
12/23/2009 1:32:46 PM / 12/23/2009
5/13/2009 1:08:27 PM / 5/13/2009
1/5/2009 10:24:12 AM / ---
5/7/2009 10:10:04 AM / ---
 
It looks like it's already a date, so I wouldn't use CDate(). Presuming so, I'd either use Format() or DateValue(). Either should work without the Left() function.
 
I used the DateValue function and that worked. Thanks for your help.
 
No problemo, and welcome to the site by the way!
 

Users who are viewing this thread

Back
Top Bottom