locked
Group by in data view web part RRS feed

  • Question

  • Hi,

    I have a data view web part with a date column. I need to do group by on that date showing weekly data.

    This week

    Week -1

    Week -2

    How can i do this?

    Tuesday, May 3, 2011 2:36 AM

Answers

  • Hello,

    Start by adding a calculated column to your list, call the column weekNumber, then add this formula to the column:

    =INT(([Start Time]-DATE(YEAR([Start Time]),1,1))/7)

    Now you will have a numbered week value that you can group on.

    Thanks!

    Tom


    Tom Molskow - SharePoint Architect - Microsoft Community Contributor 2011 Award - Linked-In - SharePoint Gypsy
    • Marked as answer by Emir Liu Wednesday, May 11, 2011 2:15 AM
    Tuesday, May 3, 2011 11:33 AM