Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

How to filter by Date & Time in DFWP or List

  Asked By: Miguel    Date: Dec 24    Category: Sharepoint    Views: 7198

I have a DFWP that is pulling from an announcements list. I have two
datetime fields, Begins and Expires. I want to filter the data so that
it looks at both the date and the time of each field. I tried just
using the basic filter in the list (Begins >= [Today} and Expires <=
[Today]) but this filters by Date only. How do I filter by date and



3 Answers Found

Answer #1    Answered By: Nagesh Maulik     Answered On: Dec 24

I found the answer to this and wanted to post this for anyone else that
may need to do this.


Answer #2    Answered By: Jonathan Scott     Answered On: Dec 24

Your observation is correct, per default the DFWP filters  by date  only.

I have no way to check this out at the moment, but out of the top of my
hat, you need to do the following:

- switch to Code view

- find the data  source

- open the tag property task pane

- and change the selectcommand CAML from
<Value Type="DateTime"> to
<Value Type="DateTime" IncludeTimeValue="True">
for all date fields  that needs to be filtered by date/time

If you need more info Google up IncludeTimeValue="True", it was blogged

Answer #3    Answered By: Katherine Williams     Answered On: Aug 10

Thank you Jonathan Scott!

This worked perfectly.

Simply adding IncludeTimeValue="True" to my SharePoint list is now filtering my results by time.

Much appreciated!

Didn't find what you were looking for? Find more on How to filter by Date & Time in DFWP or List Or get search suggestion and latest updates.