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!

IIF statement with multiple criteria

Status
Not open for further replies.
Jun 23, 2008
55
GB
I'm trying to convert a Crystal formula into SSRS and so far have got the following:

=IIf((Fields!DateStart.Value>= Today - 21)
And (Fields!HistoryType_Ref.Value = "G" or "K")), 1, 0

but it's mostly underlined in red and showing 'wrong number of arguments'

what I'm trying to say is that if the Date Start is 3 weeks ago AND the HistoryType_Ref is G OR K then true, else false.

I have only come across IIF statements since moving to SSRS and I can't find anything in my book for multiple criteria.

Annie
 
brackets brackets brackets!

=IIf(Fields!DateStart.Value>= Today - 21 And (Fields!HistoryType_Ref.Value = "G" or Fields!HistoryType_Ref.Value ="K")), 1, 0)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Darn those brackets, they'll be the death of me!! lol

Thanks Geoff

Annie :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top