date conversion function not working

B

Ben

Hi all,

I use Access 97. In my query, I have a two text fields,
1) Month, like this: APR 2004 or DEC 2004
2) Date, like: 2004-05-05 or 2004-09-23

In my sql, I tried to convert them using:

DateValue(month)

This used to work until recently after I upgraded to WinXP.
Now, it doesn't work, so I tried to use the CDate(month), and that doesn't
work either.
It gives me this error message:

Compile error in query expresssion 'DateValue(month)' and
Compile error in query expresssion 'CDate(month)'

I am not sure why. Can you share your thoughts? This query is out in the
company network and is used by many users. Thanks for your thoughts.

Ben
 
R

Rick B

"month" is a reserved word and should not be used to name a field. Neither
should "date".

Rick B
 
B

Ben

Rick,

it's still doesn't work,
I tried to renamed the field to month_dt and date_dt and adjust the field
names in my query and still get the same compile error.

Any ideas? Thanks.

Bne
 
B

Ben

Duane,

what is it supposed to do, I tried this and did not work. Thanks.

Ben

Duane Hookom said:
Try:
DateValue("1 " & [Month])

--
Duane Hookom
MS Access MVP
--

Ben said:
Hi all,

I use Access 97. In my query, I have a two text fields,
1) Month, like this: APR 2004 or DEC 2004
2) Date, like: 2004-05-05 or 2004-09-23

In my sql, I tried to convert them using:

DateValue(month)

This used to work until recently after I upgraded to WinXP.
Now, it doesn't work, so I tried to use the CDate(month), and that doesn't
work either.
It gives me this error message:

Compile error in query expresssion 'DateValue(month)' and
Compile error in query expresssion 'CDate(month)'

I am not sure why. Can you share your thoughts? This query is out in the
company network and is used by many users. Thanks for your thoughts.

Ben
 
D

Duane Hookom

This expression could be used in a query to display your text as an actual
date.

--
Duane Hookom
MS Access MVP


Ben said:
Duane,

what is it supposed to do, I tried this and did not work. Thanks.

Ben

Duane Hookom said:
Try:
DateValue("1 " & [Month])

--
Duane Hookom
MS Access MVP
--

Ben said:
Hi all,

I use Access 97. In my query, I have a two text fields,
1) Month, like this: APR 2004 or DEC 2004
2) Date, like: 2004-05-05 or 2004-09-23

In my sql, I tried to convert them using:

DateValue(month)

This used to work until recently after I upgraded to WinXP.
Now, it doesn't work, so I tried to use the CDate(month), and that doesn't
work either.
It gives me this error message:

Compile error in query expresssion 'DateValue(month)' and
Compile error in query expresssion 'CDate(month)'

I am not sure why. Can you share your thoughts? This query is out in the
company network and is used by many users. Thanks for your thoughts.

Ben
 
Top