Reputation: 31313
Using Azure Cosmos db, I have the following data...
What would be the SQL query to return all records that match the date '2/29/2020' (irrespective of the time value)?
I have tried something like this (found it on another SO post), but it gives a syntax error.
select c.* from c where c.ReadingDate BETWEEN '2020-02-29' and '2020-02-29'
Upvotes: 3
Views: 1043
Reputation: 7563
You could use the STARTSWITH function to match the date portion:
SELECT * FROM c where STARTSWITH(c.ReadingDate, "2020-02-29")
Upvotes: 2