access query- get missing operator error

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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]
 
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]
 
Back
Top