use case statements to group data together
I want to create a report that shows me a count of the opportunities that have closed in the last 30, 60 and 90 days.
I used this case statement in my report and i'm getting wierd results so i suspect there is something wrong with the syntax.
CASE WHEN TIMESTAMPDIFF(SQL_TSI_DAY, Opportunity."Close Date", CURRENT_DATE) > 90 THEN 'OLDER THAN 90 DAYS' WHEN TIMESTAMPDIFF(SQL_TSI_DAY, Opportunity."Close Date", CURRENT_DATE) <=60 THEN 'LAST 60 DAYS' WHEN
TIMESTAMPDIFF(SQL_TSI_DAY, Opportunity."Close Date", CURRENT_DATE) <=30THEN 'LAST 30 DAYS' END
this is what i get, which is not right.
LAST 60 DAYS172OLDER THAN 90 DAYS5882 49