# Calculation

Question asked by Annette on Oct 17, 2012
Latest reply on Oct 18, 2012 by Annette

Calculation

### Post

Hi,

I'm trying to do a time calculation that gives me a result in hours and minutes between a start time and an end time.

I have the following fields:

•           Start Time
•
•           End Time
•
•           Total
•
•           Appt Status

The appt status field could be Attended, Cancelled, DNA, etc.  What I would like to do is say if the appt start is 3:00and end time 4:00 the total to return 1 hour 0 minutes.  But, if the status says DNA or Cancelled then it to return 0. (They will never be on different days so I don't need to add the start / end date to the calculation)

I tried to figure out the calculation but it is not working.  I'm still new to trying to figure out calculations and things so could anyone help me determine where I went wrong?

Case (  not ActivityStatus = "DNA" or not ActivityStatus = "Cancelled"; Hour (ActivityTimeEnd-ActivityTimeStart) & (If (Hour (ActivityTimeEnd- ActivityTimeStart) = 1; " hour, "; " hours, ")) & Minute (ActivityTimeEnd - ActivityTimeStart) & (If (Minute (ActivityTimeEnd - ActivityTimeStart) = 1; " minute "; " minutes ")))

Thanks for the help.