Showing posts with label datepart. Show all posts
Showing posts with label datepart. Show all posts

Monday, March 19, 2012

Nested iif using datepart

Could someone tell me if they see something off about this expression? I'm using it in an expression. It's giving me a syntax error.

=IIf(Fields!NTFrequency.Value = "Quarterly",IIf((DatePart("m", Now)=1), 9, month(now)-3, IIf((DatePart("m", Now)=1), 12,month(now)-1)))

Thanks, Iris

IIf((DatePart("m", Now)=1), 9, month(now)-3

Don't you need a closing parenthesis here?

|||

Yep, that worked!! Then I removed one at the end and no errors.

Thanks,

Iris

|||I get one right every now and again. Too much LISP experience, I guess.|||

LOL...I went cross-eyed looking at it. Needed a second set of eyes.

Iris