access query- get missing operator error

G

Guest

Hi
I have an access query but get the error missing operator in query expression,
Cast(string_column AS DateTime)
Here is the sql I have
SELECT column
FROM table
WHERE (Cast (string_column AS DateTime)= "3/10/2005";
Thanks--
Paul G
Software engineer.
 
J

John Vinson

Hi
I have an access query but get the error missing operator in query expression,
Cast(string_column AS DateTime)
Here is the sql I have
SELECT column
FROM table
WHERE (Cast (string_column AS DateTime)= "3/10/2005";
Thanks--
Paul G
Software engineer.

Access and SQL/Server use two different dialects of SQL, particularly
when it comes to non-ANSI extensions such as functions. CAST is not a
recognized function in a DAO query. Try

SELECT column
FROM table
WHERE CDate([string_column]) = #3/10/2005#;


John W. Vinson[MVP]
 
G

Guest

ok thanks for the information. I ended up changing the data type of the
column from string to DateTime.

John Vinson said:
Hi
I have an access query but get the error missing operator in query expression,
Cast(string_column AS DateTime)
Here is the sql I have
SELECT column
FROM table
WHERE (Cast (string_column AS DateTime)= "3/10/2005";
Thanks--
Paul G
Software engineer.

Access and SQL/Server use two different dialects of SQL, particularly
when it comes to non-ANSI extensions such as functions. CAST is not a
recognized function in a DAO query. Try

SELECT column
FROM table
WHERE CDate([string_column]) = #3/10/2005#;


John W. Vinson[MVP]
 

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

Top