if and Else condition with date in Crystal report

Asked

Viewed 311 times

1

I am fulfilling a condition in my report in order to insert "-" when the Due date is null, but error occurs when the date comes other than null. Below is the image that shows the error when I fill the due date:

imagem erro relatório

The following expression has been used in the report:

=IIf(Fields!DataVencimentoPago.Value <> "",Format(Fields!DataVencimentoPago.Value,"dd/MM/yyyy"),"-")

I tried in another way too, but without success:

=IIf(Fields!DataVencimentoPago.Value <> "", Fields!DataVencimentoPago.Value,"-")

1 answer

0

Identified the problem the component used that report does not accept null values in the field, so was carried out the following change :

=Iif(Fields! Datapayment.Value <> "01/01/0001 00:00:00",Formatdatetime(Fields! Datapayment.Value,Dateformat.Shortdate),"-")

problem successfully solved!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.