Friday, March 23, 2012

Hidden expression with dates?

Hi! How to write the syntax when you try to compare the dates. In this case I try to check if the date is empty(then it's 1/1/1900) then the field should be hidden. This is what I tried but didn't succeed:

=iif(Fields!ModifiedDate.Value="1/1/1900",true,false)

You can convert your string value ('1/1/1900') to a date with the CDate() function. With this you can compare the to value's with each other.|||

Jan Pieter Posthuma wrote:

You can convert your string value ('1/1/1900') to a date with the CDate() function. With this you can compare the to value's with each other.

Thanks for the post but unfortunately I didn't get it. The main problem is syntax - I don't know where to use Cdate() -function. I tried this:

=iif(Cdate(Fields!modifiedDate).Value) > "1/1/1900",false,true)

the compiler didn't like it :)

Can you give me an example?

|||

It just the otherway round: =iif(Fields!modifiedDate.Value=CDate("1/1/1900"), false, true)

No comments:

Post a Comment