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

[Solved] Week ending Sunday date

Started by satyagorantla, 04 Jan 2006 04:07:35 PM

Previous topic - Next topic

satyagorantla

Using the available date functions in report studio,How do I get the week ending sunday date of a particular date . For example, for 2006-01-04,week ending sunday date would be 2006-01-07.Any suggestions?

Thanks!

bdybldr

#1
Saty,
Create the following data item in your query:

CASE _day_of_week([Date], 7)

Ã,  WHEN (1) THEN (_add_days([Date], 6))
Ã,  WHEN (2) THEN (_add_days([Date], 5))
Ã,  WHEN (3) THEN (_add_days([Date], 4))
Ã,  WHEN (4) THEN (_add_days([Date], 3))
Ã,  WHEN (5) THEN (_add_days([Date], 2))
Ã,  WHEN (6) THEN (_add_days([Date], 1))
Ã,  WHEN (7) THEN ([Date])
Ã,  ELSE ([Date])Ã,  --- Or whatever you want as default.
END

Hope this helps.Ã,  Keep us posted.

satyagorantla

That worked.Thanks very much!

bdybldr

I'm glad it worked.  Thanks for the update.  Please close the thread (see board rules).  Thanks.