Date Conversion

G

Guest

Hi,

I was wondering if anyone could help me??

I am trying to convert a field in my db from a text field to a date field
using the following expression:

CDate(format([warre],"Short Date")). The date is currently stored as 060401
but when i run the query with the above expression in I get an output of
14/05/65.

Please help!!

Many thanks.
 
G

Guest

Assuming that 060401 is 6th April 2001, you could try

DateSerial(right(warre,2), mid(warre,3,2), left(warre,2))

Hope This Helps
Gerald Stanley MCSD
 
G

Guest

If you wont get any other better answer then you can use that
CvDate(left("060401",2) & "/" & mid("060401",3,2) & "/" & right("060401",2))

replace the 060401 with the field name
 
G

Guest

If you wont get any other answer then you can try
CVDate(left([warre],2) & "/" & mid([warre],3,2) & "/" & right([warre],2))
 

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

Similar Threads

Date Conversion 5
Date criteria problem 16
Date Expression 2
query on date 1
#error - Blank 3
Format() function in Access 2003 4
IIF Statement to return multiple values for a field - JohnW 3
Sort on Date 1

Top