Jump to content

Time between dates if statement


Gregg Arnold 2

Recommended Posts

I have two colums, one for failure date and one for install date. I can perform the basic function of subtracting one from the other to get run time, however, when there is no failure date input I want to know the current number of days running but if there is a failure date, I want to show that calculation.

The expression I am trying to use is:

case

when [Failure Date] Is Null, DateDiff('Day',[install Date],DateTimeNow())

ELSE [Failure Date] - [install Date]

END

I have also tried:

If([Failure Date] Is Null(), DateDiff("Day", [install Date], DateTimeNow()), DateDiff("Day",[install Date],[Failure Date]))

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...