Search code examples
sqlcrystal-reportsreport

combine and sum multiple groups


I have been having trouble for a while figuring this out.I have managed to generate fields based on weeks.

enter image description here

Now I want something like this

enter image description here

In Crystal reports How can I achieve this?


Solution

  • i have faced the same case and i found 2 options to solve the same 1- from db level you can add new column to get week number in that year and then get the sum value according to week number.

    2- from crystal report, you can set number of weeks in a running field and use mod to get the division remaining (week number mod 2), if it is equal to zero then you can get the sum or reset the sum parameter.

    enter image description here

    in the formula sum field:

    {@DayName} = "Friday" AND {RptEmpMove;1.WeekNum} mod 2 = 0