Can u tell me how to compare the date as well as time stored in a SPList as a DateTime field with the current system time using a CAML query?
+5
A:
To compare with todays date:
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime'><Today /></Value>
</Lt>
</Where>
To compare todays date AND time
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime' IncludeDateTime='TRUE'><Today /></Value>
</Lt>
</Where>
To compare yesterdays date
<Where>
<Lt>
<FieldRef Name='Created'/>
<Value type='DateTime'><Today Offset='-1' /></Value>
</Lt>
</Where>
Janis Veinbergs
2010-06-27 15:52:48