Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 570
Tabares Avatar asked Aug 21 '13 16:08

Tabares


2 Answers

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>
like image 51
Tabares Avatar answered Sep 30 '22 18:09

Tabares


First, SharePoint filtering using the [Today] wildcard only compares dates, not times. To my knowledge there is no web interface way of comparing times.

Assuming "TimeOver" is a your project deadline and "Start" is when the project begins...

Add something to a list when it is overdue by saying: TimeOver is Less than [Today]

Add something to a list when it was started today: Start is equal to [Today]

Add something that was created in the past week: Start is greater than [Today]-7

Add something to a list that is due within 30 days: TimeOver is greater than [Today] AND TimeOver is less than [Today]+30

like image 45
user2366153 Avatar answered Sep 30 '22 19:09

user2366153