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

how to extract weekend date from the current date

Started by Prakash Bhai, 04 Jul 2011 07:57:57 AM

Previous topic - Next topic

Prakash Bhai

Hi Gurus,

how to extract weekend date from the current date.
Ex: I need to get the dynamic weekend dates from the souce of dates which has all weekend dates... when I run a report I need to get the weekend date of that particular week dynamically.

i.e..If I run the report in this week I need to get 8-7-2011 dynamically.cos as 8-7-2011 will be last day of weekend.

Regards,
Ram

CognosPaul

You'll need to use a dayofweek function for this. Essentially you need to do something like:

add_days([Date], (7 - dayOfWeek([Date])))

Depending on your DB settings this would either return the Sunday or Saturday.

If you're using Oracle you could use the next_day function. next_day([Date],'Saturday')