In a SharePoint calendar list I create two events w/ today's date. One I make an all-day event, the other I set the start time to be 12 AM and the end time to be 11:55 PM.
When I create a CAML query (in this case w/ "U2U CAML Query Builder") I'm seeing some weird behavior. When my query is a simple "OrderBy" both events are returned.
When I execute the following query that searches for events that are greater than or equal to today, only the event that is NOT marked as an "All Day Event" is returned:
<Where>
<Geq>
<FieldRef Name='EventDate' />
<Value Type='DateTime'>2009-10-05T00:00:00Z</Value>
</Geq>
</Where>
Examining the results from the query builder tool I see that the values for EventDate (the internal name of the Start Time column) are identical (2009-10-05 00:00:00).
Why does SharePoint treat these two events identically? Could it be a time zone issue?
EDIT: More info, I think this might be a time zone issue. I discovered the "IncludeTimeValue" attribute of the Value element - described here: MSDN. I am on the East Coast (currently GMT - 4 hours). If I edit the Value
element as follows: (note the date is now the 4th, not 5th)
<Value Type='DateTime' IncludeTimeValue='True'>2009-10-04T20:00:00Z</Value>
Then both events are returned, but if I go up to 20:01 then I lose the all-day event. When I go to 20:01 I lose the all-day event as well. Anyone know where I can find a thorough description of this behavior?
EDIT2: I confused myself; corrected the first edit.