Hi All,
I am required to calculate number of days between two slected dates at the prompt. For example, if a user selects 1 July,2012 as start date and end date as 7 July, 2012; the expression should tell me the number of Mondays (1), Tuesdays (1), Wednesdays (1), Thursdays(1) and Fridays(1).
I am using the following expression condition but it is not calculating properly. Can someone please let me know what is wrong with my expression?
round((_days_between (cast(?End Date?,date),_add_days(cast(?Start Date?,date),1)) - mod (2-(_days_between (cast(?Start Date?, date), 1900-01-01)),7)
)/7,0)
Thanks in advance.
Cheers, V
I propose to use three query items
The first one would be the [Date] in which are you going to apply the filter based on users selection
The second one would be the [Weekday] (for example you can fine which day of the week is from the date)
The third one [Count of Weekday] with expression count([Weekday]"
Thanks pricter for your quick reply, appreciated. I will give a go to the suggested solution by you and will let you know if it worked for me.
However, considering my expertise oin Cognos, it may take me sometime :)
Anyway, thanks for your help :)