Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a dataview web part displaying data from a list which I've designed using SharePoint designer. How do I filter it so that I show data from last year as well as the current year?

Note: It should be dynamic, keep changing based on the current date. Any help is appreciated. Thanks!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You can use a tool like U2U CAML builder to create a dynamic CAML query to put into the select command of the DVWP. This would be dynamic in that the CAML would utilize an offsetdays based off of [Today].

share|improve this answer
    
Thanks for replying. I can't use 3rd party tools but your comment gave me an idea: using CAML query to do it. Found out just what I wanted here: msdn –  uberz91 Jan 11 '13 at 8:37
    
The tool is just used for building the CAML which in turn you'd put into the Select Command of the generated DVWP. –  PirateEric Jan 11 '13 at 16:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.