0

I am using SSRS 2008 R2 with SQL 2008. I have a report that lists dates that a client uses a service. I have grouped on the client name and the detail section is the dates. I am trying to check if a date for a specific client is duplicated(Has been entered twice). To do that I am using an IIF statement.

=IIF(Fields!SvcDate.Value,"table1_ClientName"=Previous(Fields!SvcDate.Value,"table1_ClientName", "Khaki", "White")) 

If I run this expression without the scope in it, it colors the field correctly, but of course the "previous" part of this means that if another client directly above has the same date, this expression thinks that is the "previous" date and I get a background color. So I need to make sure that the colors and the "previous" criteria are limited to each individual client. The expression above gives an error that says that there is no False part to the statement. So I'm thinking that I have the parentheses wrong somehow, but I can't figure out how to correct it.

Gonzalo.-
  • 12,512
  • 5
  • 50
  • 82
Carol
  • 1
  • 1
    Tags [SSRS-2008] and [SQL-Server-2008] will highlight your question to more experts than [iif] and [scope]. – Artemix Sep 17 '12 at 19:00
  • This looks like wrong number of arguments. Basic syntax for IIF statement is: =iif(Fields!examplefield.Value="xyz","#56ca29","#ff6969") so, if the value of examplefield is equal to 'xyz' then be green, otherwise be red. Am I correct in assuming "table1_ClientName" is the name of a dataset? – JsonStatham Sep 21 '12 at 06:40

1 Answers1

0
=iif(Fields!SvcDate.Value = previous(Fields!SvcDate.Value),"Khaki","White")  

Let me know if the "table1_ClientName" is a Dataset name, and is a requirement and I will ammend.

JsonStatham
  • 9,770
  • 27
  • 100
  • 181