DateDiff in SQL Server
I didn't realize how difficult it can be to query on dates. Because a date consists of a date and a time, when you want to see if a date is the current date, using the getdate() mechanism, it won't match because the time isn't exact. How can you correct this? Using the datediff method in SQL Server. DateDiff takes two dates, and verifies certain parameters (the list is in the MSDN documentation link a few words over). I've used it more in this context though:
select * from MyTable where datediff(dayofyear, RequestDate, getdate()) = 0
DateDiff returns an integer value if the dates match, which would equal zero, or if they don't, which will be a positive or negative number based on which date is greater. This way, you can search based only on the date. You can also use the day parameter to determine if it is the same day, and a variety of other terms defined in the list. You need to use a mechanism like this, or one of the other date methods, to make date determinations.