If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Need to display past week data

Started by lifzgud, 03 Sep 2009 05:14:18 AM

Previous topic - Next topic

lifzgud

For eg.
If i run the report on Monday or any other weekday , it should show me the data from last weeks saturday to the present week's sunday

eg. If i run the report on 14th sept 2009 it should show me data from 6th to 12th sept.There is a date column present in my report that i am using in the filter
Any idea on how to go abt this?

sridharansathya

#1
case when to_char(sysdate,'Day') in ('Monday' )
then date between add_days(to_char(date),'-8') and add_days(to_char(date),'-1')
to_char(sysdate,'Day') in ('Tuesday' )
then date between add_days(to_char(date),'-9') and add_days(to_char(date),'-2')
similarly till friday

I have just framed the logic , not tried with it........
Please check this logic whether it suits or not and let me know.........

Sathya.