I am trying to get all the records from the last 2 days but excluding today's date. I want to get name and location where date submitted is included for the last 2 days only. The data type for date_submitted
is datetime
.
select name, location
from myTable
where date_submitted in (select CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME))