Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

How to filter by Date & Time in DFWP or List

  Asked By: Miguel Sullivan         Date: Dec 24, 2008      Category: Sharepoint      Views: 960
 

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
time?

Tagged:                    

 

2 Answers Found

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

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

nickgrattan.wordpress.com/.../filtering-views-by-time-and-
date/#comment-635

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

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
before.

 
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.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].