#ERROR convert to 0

Hi experts

I am working different between 2 date (1 is process date - current date).
Formula is working fine but where order is not process date is blank.

I tired to use formula If([process]="";0;[process]).

But not work.

Need your support to identity formula to convert #ERROR to 0.

We need more details. Are you trying to subtract current date from process date? That doesn’t work, not when you actually have objects or variables with a datatype of Date time.

Noel

The general way of calculating difference in days in Webi is
=DaysBetween([First Date];[Last Date])

It sounds like you need something to handle the nulls in [Process Date]
If you want 0 as your outcome then I’d suggest a variable Denulled Process Date like:
=If IsNull([Process Date]) Then CurrentDate() ELSE [Process Date]

Then your DaysBetween based on the above will be:
=DaysBetween([Denulled Process Date];CurrentDate())

If Process Date is null, then the above will evaluate as
=DaysBetween(CurrentDate(),CurrentDate())
and will therefore be the 0 that you want.

2 Likes