Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Functions

Status
Not open for further replies.

rkiss

Programmer
Jun 2, 2006
9
Hi, I would like to know the equivalent Cognos 8BI expression for the following MS SQL query:


SELECT convert(varchar(10), dateadd(d, 1 - datepart(w, getdate()), getdate()), 101) AS last_sunday

The above sql query will return the date of last Sunday on any given day of the week.


Thank you,

Roman
 
Here is the answer:

_add_days(current_date,-1*(_day_of_week(current_date,8)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top