Scenario 1: I want to get items which are greater than or equal to Today's date
<Query><Where><Geq><FieldRef Name="EndDate" /><Value IncludeTimeValue="TRUE" Type="DateTime"><Today /></Value></Geq></Where><OrderBy><FieldRef Name="StartDate" Ascending="False" /></OrderBy></Query>
The attribute "Today" helps in defining the date to be Current Date
Scenario 2: We Want to get result from say 5 days from Today
<Query><Where><Geq><FieldRef Name="EndDate" /><Value IncludeTimeValue="TRUE" Type="DateTime"><Today Offset="5"/></Value></Geq></Where><OrderBy><FieldRef Name="StartDate" Ascending="False" /></OrderBy></Query>
The Attribute "Offset" defines the No.of days we want to go back
No comments:
Post a Comment