I am using Cognos 10.2 with DB2
I would like to get the beginning day of the week for a date. I tried this, but it says:
This give:
[BusinessView].[DELTICKET].[Start Date]-dayofweek( [BusinessView].[DELTICKET].[Start Date]) days
gives this error:
V5 syntax error found for data item 'Week Of' of query 'Query1', invalid token "days" found after "[BusinessView].[DELTICKET].[Start Date]-dayofweek( [BusinessView].[DELTICKET].[Start Date]) ".
However, this
[BusinessView].[DELTICKET].[Start Date]-1 days
Runs without error.
Only difference is -dayofweek function for the desired date.
Any idea what I am doing wrong here.
Try using the add days function:
_add_days ( [BusinessView].[DELTICKET].[Start Date], ( _day_of_week ( [BusinessView].[DELTICKET].[Start Date] * -1 ) )
That did it. Thanks.