DHRUV KAUSHAL
DHRUV KAUSHAL

Reputation: 127

Message 102 Level 15 error SQL Server: Incorrect syntax

I am facing an error while running a SQL query.

The error I am receiving is:

(102, b"Incorrect syntax near '2020-01-31 00:00:00'.DB-Lib error message 102, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 102, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\nDB-Lib error message 102, severity 15:\nGeneral SQL Server error: Check messages from the SQL Server\n")

Since the query is lengthy, I am putting only part of the query where the error is being shown:

T1.submit_date < ts '2020-01-31 00:00:00'

If need be, I will edit and put the entire query.

Any help is appreciated.

Thank you.

Upvotes: 0

Views: 2759

Answers (1)

Martin Smith
Martin Smith

Reputation: 453897

This is not the correct format for ODBC escape sequences. It should be wrapped in {}

where T1.submit_date < {ts '2020-01-31 00:00:00'}

Upvotes: 2

Related Questions