3 Replies Latest reply: Jul 13, 2016 3:22 AM by Onno van Knotsenburg

# Conditional If Statement

Hi,

I have two time variables "Call Start" and "Time Created," I am looking to create an if statement that occurs only when the two variables are within 30 minutes of one another (i.e. if the Time Created occurs 30 minutes or less after the Call Start(ed))

Thanks!

• ###### Re: Conditional If Statement

Something like...:

If([Time Created] - [Call Start] > 1/48, 'Yes', 'No')

Assuming both fields are time stamps.

• ###### Re: Conditional If Statement

How do you get the fraction 1/48 from the time stamps?

Thanks!

Emma

• ###### Re: Conditional If Statement

Dates (including time) are stored as numbers. A date is the whole number (the part before the decimal point), the time are the fractions of the number (the part behind the decimal point).

So if you wanted to check if the difference is more then 1 day, you would have made it > 1.

But you want to check if the difference is more then 30 minutes. To get to minutes, you divide 1 by 1440 (the number of minutes in a day). You want 30 minutes, so 30 * 1/1440 = 1/48. 48 is the number of half hours in a day.

I hope that clears things up for you .