I am sure this is an easy one for some of you, but not being an expert in SQL or in Access2000 so I am stuck!
I have a linked SQL table in Access that has a field containing dates formatted as text. The dates are text in the form 20050817.
In my query I need to change this column of data into a date field in the form mm/dd/yyyy, so that users can input two dates and I can use them to query the column. I tried using
CAST(fieldname as datetime),
but it turned data like 20050517 into 08/15/05 - not the right date at all. I then read some of the answers here, and I tried
CDATE(MID(fieldname,5,2)&"/"&Right(fieldname,2)&"/"&Left(fieldname,4)).
Access came back to tell me that MID was not a valid function.
How can I accomplish what I am trying to do?
Cait
I have a linked SQL table in Access that has a field containing dates formatted as text. The dates are text in the form 20050817.
In my query I need to change this column of data into a date field in the form mm/dd/yyyy, so that users can input two dates and I can use them to query the column. I tried using
CAST(fieldname as datetime),
but it turned data like 20050517 into 08/15/05 - not the right date at all. I then read some of the answers here, and I tried
CDATE(MID(fieldname,5,2)&"/"&Right(fieldname,2)&"/"&Left(fieldname,4)).
Access came back to tell me that MID was not a valid function.
How can I accomplish what I am trying to do?
Cait