A
A
alex995052017-09-21 10:46:41
SQL
alex99505, 2017-09-21 10:46:41

Why is there a Syntax error (missing operator) if there is one?

From Trace Mode I make a query:
SELECT
COUNT(*)
FROM
Table
WHERE
(Table.DateTime > DATE(DATE_SUB(CURDATE(),INTERVAL 8 HOUR)))
and I get an error:
[Microsoft][Microsoft Access ODBC Driver] Syntax error ( missing operator) in query expression '(Table.DateTime > DATE(DATE_SUB(CURDATE(),INTERVAL 8 HOUR)))'. (-3100)
But the operator is specified. Why is this happening, who knows?
UPD:
I read that Access accepts a date in this form DateValue("20/09/2006").
I remade the query differently, it didn't help:
SELECT
COUNT(*) #Cout_rows_R#
FROM
Table
WHERE
DateValue(Table.DateTime) > DateValue("20/09/2006")
Got an error - Too few parameters. Expected 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2017-09-21
@SaNNy32

SELECT COUNT(*) 
FROM Table
WHERE DateValue(Table.DateTime) > DateValue("20/09/2006")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question