Solution -
1- Create a Calculated column in list. The formula should be -
- Name - ModifiedHrs
- Type - Calculated
- Formula: =HOUR(Modified)
- Format -Number (1, 1.0, 100)
Number of decimal places: 0
3. Now Open the view page (DayState.aspx) in SharePoint Designer code view [Edit in Advance Mode]
4. Locate the CAML query associated with the filter (Modified = [Today]), you can find something like
<WebPartPages:WebPartZone ---
<WebPartPages:XsltListViewWebPart ----
-----
<XmlDefinition>
<View --->
<Query>
<OrderBy>--</OrderBy>
<Where>
<Eq>
<FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value>
</Eq>
</Where>
</Query>
<ViewFields---->
----
</View></XmlDefinition>
</XmlDefinition>
5. Replace the <Where>----</Where>
<Where>
<Or><And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today OffsetDays="-1"/>
</Value></Eq><Gt><FieldRef Name="ModifiedHrs"/>
<Value Type="Number">14</Value></Gt></And>
<And><Eq><FieldRef Name="Modified"/>
<Value Type="DateTime"><Today/></Value></Eq><Lt>
<FieldRef Name="ModifiedHrs"/>
<Value Type="Number">16</Value></Lt></And></Or>
</Where>
6. Save the page , and test in browser
1 comment:
Very informative post... Thanks...
Post a Comment