How to compare only date part when delivery date is today
I'm trying to create a report that gets records from a SQL Server database where the delivery date is today. I've tried select * from (tablename) where delivery_date = getdate() Although that didn't give me any errors, it didn't give me any records either. I'm assuming it is because all dates are like: 2016-03-15 00:00:00.000 Perhaps, I need to truncate the date to remove the time-stamp and then try? You can try a query like below select * from (tablename) where CAST(delivery_date as date) = CAST(getdate() as date) Also if all delivery dates have time part like 00:00:00.000 for sure then