January 6, 2016 at 8:00 am
Hi All,
Any help is appreciated as I think I am almost there!
so what I want to do is from a report which contains a lot of data to select basically the data that matches the month and year of yesterday's date.
I have this expression but am getting a red squiggle under the Today() in the first part for some reason and it won't work.
.=sum(iif(Fields!Month_Place_Test.Value = DatePart(DateInterval.Month, DateAdd(DateInterval.Day, -1, Today()),0, iif(Fields!Year_Place_posted.Value = datepart(DateInterval.Year, Dateadd(DateInterval.Day, -1, Today()), Fields!Places_Posted.Value))))
I am so almost there, I can feel it but can't work out where I have gone wrong.
Thanks for the help as always
Edited for Today not now and putting it around code heh
January 6, 2016 at 9:40 am
January 6, 2016 at 10:32 am
Your bracketing is a bit off and you need an And in there (it's easier to read then nested iif's when there are only two outcomes) - this should work:
=sum(
iif(
Fields!Month_Place_Test.Value = DatePart(DateInterval.Month, DateAdd(DateInterval.Day, -1, Today())) And
Fields!Year_Place_posted.Value = DatePart(DateInterval.Year, Dateadd(DateInterval.Day, -1, Today())),
Fields!Places_Posted.Value, 0
)
)
January 7, 2016 at 1:44 am
Thank you both, for the link and help. It is appreciated. I have been doing more in excel so this time gave this a proper go rather than my usual ask for assistance as I didn't know where to start!
Get me? I am terrible with brackets but getting there. I will give this a try, got some at home time off soon so going to have a swot up on expressions I think.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply