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!


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

  • 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 – Akhoy 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. – Eric Alexander Jan 11 '13 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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