CRM On Demand - Reports and Dashboards (MOSC)

MOSC Banner

use case statements to group data together

edited Apr 10, 2013 3:45PM in CRM On Demand - Reports and Dashboards (MOSC) 1 commentAnswered
Hi,

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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center