We've got an Events table which has fields for StartDate and EndDate (date and time to be prceise). If the event is an all day event, it is stored with 12:00 AM in the entity object which saves it to the database with only the date value (no time value). All other events that don't start at midnight (12am) have the time value.
In code, we've got a filter set up get events that fall within a start or end range. If I query for events that start or end "BETWEEN '7/5/2005 12:00:00 AM' AND '7/5/2005 11:59:59 PM'", I get two rows when I only expected one row. The extra row that comes back has StartDate = 7/6/2005 and EndDate = 7/6/2005.
If I run the exact same query generated by LLBL (that I pulled from Visual Studio) in Query Analyzer, I end up with only the one row I was expecting.
Is it just me? Or is there some type of date rounding going on behind the scenes? I read a couple of threads about how the query you get from LLBL might not be the same as what is actually run (http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=1394) and saw another thread (which I've lost) about dates without times.
Any help is appreciated. This is one of those 'bang your head against your desk' problems right now.
Matt