mike
mike

Reputation: 1233

Why is SQL timestamp comparison not working?

In SQL where clause there is a comparison to a timestamp field:

timecrtd > '2017-03-01-00.00.00.000000' 

However, data returned suggests the comparison is not working.

Upvotes: 0

Views: 766

Answers (1)

Widor
Widor

Reputation: 13275

The format of your string can't be implicitly converted to a timestamp. You may need to explicitly use CAST() or CONVERT()

'2017-03-01 00:00:00.00' should work implicitly, however.

Upvotes: 2

Related Questions