Converting text date to number date

Tony

Registered User.
Local time
Yesterday, 21:19
Joined
Oct 30, 2008
Messages
16
I'm currently having trouble with the Cdate(expression). I don't quite understand how to apply it.

I have a table that contains a field titled LD with the following date format: "2011-01-12 11:00", but in text format.

Does anyone know How to eliminate the time and convert the text date into a number date so that I can apply conditional formatting to it?

Respectfully,

Tony
 
Hi Tony,
Try Format( '2011-01-12 11:00', "dd-mm-yyyy")
 
DateValue("2011-01-12 11:00")

Should remove the timevalue

JR
 
I always use Dateserial, it is simple and fool proof returning a date in your default format,

Dateserial(year,month,day)
thus in your case I think
Dateserial(left(LD,4),mid(LD,6,2),mid(LD,9,2))

Brian
 
Thanks guys for the quick responses.

I've tried inserting the expression in the format section of the properties sheet, as well as the the criteria section of the querry table, but no results.

Could you talk me through the steps of how I would apply these expressions?

Thanks again for your help.

R,

Tony
 
Put the expression in the Controlsource of the control and make it a calculated control.

=Dateserial(left([Field],4),mid([Field],6,2),mid([Field],9,2))

where [Field] is the name of your tablefield in the forms recordsource.

JR
 
JANR,

It worked! Thank you very much for the input.

R,

Tony
:)
 

Users who are viewing this thread

Back
Top Bottom