I have an SQL query:
SELECT ....
WHERE CalendarDateTime.StartDate >= NOW()
How can I change the NOW()
part to reference yesterday?
I have an SQL query:
SELECT ....
WHERE CalendarDateTime.StartDate >= NOW()
How can I change the NOW()
part to reference yesterday?
SELECT ....
WHERE CalendarDateTime.StartDate >= NOW() - INTERVAL 1 DAY
But I guess StartDate
is a DATE and what you actually want is to include today's events, which your current solution does only at midnight. In that case the more appropriate solution is:
SELECT ....
WHERE CalendarDateTime.StartDate >= DATE(NOW())