Page 1 of 1

Default Appt Lengths

PostPosted: Mon Jul 08, 2013 11:08 am
by IllyssaT
I was working on creating a calculation that said if the Status was X then make the End Time 1hr after Start time. Since there was already a calculation in End Time I tried to add this on the end:

If ( Status = "Pregnancy Test" ; Truncate (TimeStart + 0; 60 ; 0)

This is obviously not working. FileMaker says I need an additional modifier. I'm sure someone before me has done this.

Tips or tricks?

Re: Default Appt Lengths

PostPosted: Mon Jul 08, 2013 4:48 pm
by jeffalmquist
Hi Illyssa. The TimeEnd field needs to be a Time field (not a calculation field), so I assume you're talking about the auto-enter calculation formula. Try editing it to look like this (I just added the first line about the pregnancy test):

Case (
Status = "Pregnancy Test" ; TimeStart + 3600 ;
Self = Time ( 24 ; 0 ; 0 ) ; Time ( 24 ; 0 ; 1 ) ;
Self = Time ( 0 ; 0 ; 0 ) ; Time ( 0 ; 0 ; 1 ) ;
Self > Time ( 24 ; 0 ; 0 ) ; Self - Time ( 24 ; 0 ; 0 ) + 1 ;
Self )

Re: Default Appt Lengths

PostPosted: Tue Jul 09, 2013 6:12 am
by IllyssaT
Jeff- that worked wonderfully thank you. Why is it plus 3600 if you don't mind me asking? I kept trying to figure if out but couldn't. So if I wanted it to be half an hour would it be plus 1800?

Re: Default Appt Lengths

PostPosted: Tue Jul 09, 2013 6:39 am
by jeffalmquist
Great! In FileMaker calculations, time is measured in seconds, and 1 hour = 3600 seconds. So yes, half an hour would be 1800.