How do I filter by [Today] and time in SharePoint list view ?

Tabares picture Tabares · Aug 21, 2013 · Viewed 45.3k times · Source

I'm trying to filter Sharepoint lists based on date and time. But It only works with date, ignores the time in data and time field.

enter image description here

Answer

Tabares picture Tabares · Aug 28, 2013

In SharePoint Designer I edit the CAML query from my view in Advanced Mode. And I add IncludeTimeValue="True" in CAML tag Value Type="DateTime". I'm filtering my results by time.

           <Query>
                <OrderBy>
                    <FieldRef Name="Modified" Ascending="FALSE"/>
                </OrderBy>
                <Where>
                    <Or>
                        <Gt>
                            <FieldRef Name="Start"/>
                            <Value Type="DateTime"  IncludeTimeValue="True">
                                <Today/>
                            </Value>
                        </Gt>
                        <Gt>
                            <FieldRef Name="TimeOver"/>
                            <Value Type="DateTime"  IncludeTimeValue="True">
                                <Today/>
                            </Value>
                        </Gt>
                    </Or>
                </Where>
            </Query>