Monday 23 August 2010

May have a partial fix to creating a filtered Dataview for "within the past 14 days"

It seems that if you create a regular view in Sharepoint and then open the .aspx file in SharePoint Designer you can convert the view to a DataView (an XSLT view). If the original view had a filter on it then that filter is carried over into the Dataview.

I tested this out and it does appear to work. The thing is that if you look at the filter it doesn't appear to say it's going to do what it actually does. The original filter was:
ImportantDate >= [Today] - 14
i.e. ImportantDate is after or is the date 14 days before today. The filter in the DataView is:
ImportantDate is greater than or equal to [Current Date]
i.e. ImportantDate is Today or a later date.

However, when the view is displayed it displays data for the past 14 days and future dates. So, on the one hand it's "Yay it works!" but on the other it's "I don't know why it works." The latter makes me very wary of putting it into production.

No comments:

Post a Comment