dvannoy said:
I'm searching for those sesame street episodes right now
Legendary stuff. Thanks for taking it with humour.
Finally, if you simply told us what timespan you're interested in to see and whether all your due_dates are as you posted (2016-12-31 [highlight #FCE94F]00:00:00.000[/highlight]), then it's perhaps easiest you say in laymen terms, natural language.
Just one more time let me also point out, MSSQL also offers a pure date type, fields just storing the date portion of a datetime. That is a more naturally known data type. In reality we normally don't even think of a type called datetime, date and times are separate, but if you think about it, a time only is a type that is valuable for any regular things not related to a certain date, any concrete point in time only existing once in all time is a date and time or short datetime.
If you would change your due_date column to date as type, storing GETDATE() into it would always truncate off the time portion. It's not recommended, if this database is well established and much code written about it, as changing a column data type can harm already existing code to stop working, as it expects a time portion. But as I called it "for new development" I would recommend to store dates in date fields, it is less confusing and you don't need the time precision. Aside from that the functions concerned with adding time intervals or computing a difference in a time interval granularity are also applying to date types, obviously only down to the time intervals of at least a day, i.e. it makes no sense to add a second to a date, that will be rounded down to the same date anyway. And when I talk of time intervals, I simply mean seconds, minutes, hours, days, weeks, months, years, just the usual time intervals you're used to think in and calculate in. Just look at DATEADD() and DATEDIFF() alone, each of them is very straight forward to understand.
And last not least, as the data type date was only established in (let me lie) 2008, still almost 10 years after MSSQL DB developers and DBAs are used to only working with datetimes. Once you get into the "mood" or "groove" of how to think about them everything is logical and fine, but it almost guarantees newbies to fail to create filter conditions.
Bye, Olaf.