Sunday, February 19, 2012

Iif and format statements

I am trying to format a database field to a Year format and check the results
against a Year value (the 2002 would become a paramater entered by the user).
Then if the results are true, then format the database field to display
month year. Below is the iif statement:
=iif(format(Fields!CREATION_DATE.Value, "yyyy") = 2002),
Format(Fields!CREATION_DATE.Value, "MMM yy"), 0)
I am getting an error stating: Argument not specified for parameter
'FalsePart' of 'Public Function IIF(Expression As Boolean, TruePart As
Object, FalsePart As Object) As Object'.
ThanksHey Mike:
You just got an extra paranthesis up there:
Try this:
=iif(format(Fields!CREATION_DATE.Value, "yyyy") = 2002,
Format(Fields!CREATION_DATE.Value, "MMM yy"), 0)
"Mike" wrote:
> I am trying to format a database field to a Year format and check the results
> against a Year value (the 2002 would become a paramater entered by the user).
> Then if the results are true, then format the database field to display
> month year. Below is the iif statement:
> =iif(format(Fields!CREATION_DATE.Value, "yyyy") = 2002),
> Format(Fields!CREATION_DATE.Value, "MMM yy"), 0)
> I am getting an error stating: Argument not specified for parameter
> 'FalsePart' of 'Public Function IIF(Expression As Boolean, TruePart As
> Object, FalsePart As Object) As Object'.
>
> Thanks

No comments:

Post a Comment