6 Replies Latest reply on Mar 14, 2012 1:30 PM by jayankurian

# Time calculation

Time calculation issue

My fields

1. Accession TimeStamp: 7/1/2011 1:50 AM
2. Accession Time: 1:50 AM (which is the calculation result – Right ( Accession Timestamp ; 8 ) Result is in Text

Trying to create the following calculation field and it is not working.

3. Tour I: If(Accession Time >= 00:01 AM and Accession Time <= 08:00 AM ; “Tour I” )

( Unable to save the calculation.)

3. Tour I: If(Accession Time >="00:01 AM"and Accession Time <=08:00 AM ; “Tour I” )

(able to save the calculation, but no result)

Please tell me "What I am doing here wrong?"

Thank you

• ###### 1. Re: Time calculation

Can you get the result of the Accession Time as a number or time instead of text?

• ###### 2. Re: Time calculation

Accession Time result was in Time.

• ###### 3. Re: Time calculation

jayankurian wrote:

Accession Time: 1:50 AM  (which is the calculation result – Right ( Accession Timestamp ; 8 ) Result is in Text

First thing: change the calculation formula to =

GetAsTime ( Accession TimeStamp )

and the result type to Time. Then make the second calculation =

Case ( Accession Time ≤ Time ( 8 ; 0 ; 0 ) ; “Tour I” )

• ###### 4. Re: Time calculation

Hi Michael,

I made the change as you suggested, not seen any result.

Also, I need to extract Tour II (criteria: > 08:00 AM and <=04:00 PM) Tour III (criteria >04:00 PM and <= 11:59 PM) from the Accession Time.

As you suggested, case statement is the best choice for the calc.

Jayan

• ###### 5. Re: Time calculation

Does the attached work for you?

• ###### 6. Re: Time calculation

Michael Horak wrote:

Does the attached work for you?

YES  it did.......

Thank you very much for your help.

Have a nice weekend.