Time intervel calculation

Time intervel calculation

am 03.12.2007 10:45:15 von J T

Can someone please help me to work out the time interval between two
times on dates that may occur on different days.

Thanks in advance

John

Re: Time intervel calculation

am 03.12.2007 18:52:31 von bill

In article
<11f65eb2-a2b5-40d9-a30a-bc7e7c625726@t47g2000hsc.googlegroups.com>,
J T wrote:

> Can someone please help me to work out the time interval between two
> times on dates that may occur on different days.
>
> Thanks in advance
>
> John

Data fields:
Date1
Date2
Time1
Time2

Date1 & Date 2 defined as Date fields, Time1 & Time2 defined as Time
fields

Calculation Field

TimeDif =
(Date2-Date1) *24*60*60
+
Time2-Time1

TimeDIff field specified to give calculation result as Time

You can of course multiply out 24*60*60 and use the result as a single
multiplication factor.

--
Bill Collins
For email, change "fake" to "earthlink"

Re: Time intervel calculation

am 03.12.2007 22:03:41 von J T

On 3 Dec, 17:52, Bill wrote:
> In article
> <11f65eb2-a2b5-40d9-a30a-bc7e7c625...@t47g2000hsc.googlegroups.com>,
> J T wrote:
>
> > Can someone please help me to work out the time interval between two
> > times on dates that may occur on different days.
>
> > Thanks in advance
>
> > John
>
> Data fields:
> Date1
> Date2
> Time1
> Time2
>
> Date1 & Date 2 defined as Date fields, Time1 & Time2 defined as Time
> fields
>
> Calculation Field
>
> TimeDif =
> (Date2-Date1) *24*60*60
> +
> Time2-Time1
>
> TimeDIff field specified to give calculation result as Time
>
> You can of course multiply out 24*60*60 and use the result as a single
> multiplication factor.
>
> --
> Bill Collins
> For email, change "fake" to "earthlink"

Thank you very much Bill

Regards

John

Re: Time intervel calculation

am 04.12.2007 08:38:01 von bobemery

J T wrote:

> On 3 Dec, 17:52, Bill wrote:
> > In article
> > <11f65eb2-a2b5-40d9-a30a-bc7e7c625...@t47g2000hsc.googlegroups.com>,
> > J T wrote:
> >
> > > Can someone please help me to work out the time interval between two
> > > times on dates that may occur on different days.
> >
> > > Thanks in advance
> >
> > > John
> >
> > Data fields:
> > Date1
> > Date2
> > Time1
> > Time2
> >
> > Date1 & Date 2 defined as Date fields, Time1 & Time2 defined as Time
> > fields
> >
> > Calculation Field
> >
> > TimeDif =
> > (Date2-Date1) *24*60*60
> > +
> > Time2-Time1
> >
> > TimeDIff field specified to give calculation result as Time
> >
> > You can of course multiply out 24*60*60 and use the result as a single
> > multiplication factor.
> >
> > --
> > Bill Collins
> > For email, change "fake" to "earthlink"
>
> Thank you very much Bill
>
> Regards
>
> John

If you are using 7 or better and just looking for number of hours
between the two, you can use the timestamp function to combine the dates
and times and do the heavy lifting:

(Timestamp ( date1 ; time1 ) - Timestamp ( date2 ; time2 ))/3600

result as a number

Re: Time intervel calculation

am 04.12.2007 09:08:16 von bobemery

Opps, my bad:

(Timestamp ( date2 ; time2 ) - Timestamp ( date1 ; time1 ))/3600

result as number

Bumper wrote:

> J T wrote:
>
> > On 3 Dec, 17:52, Bill wrote:
> > > In article
> > > <11f65eb2-a2b5-40d9-a30a-bc7e7c625...@t47g2000hsc.googlegroups.com>,
> > > J T wrote:
> > >
> > > > Can someone please help me to work out the time interval between two
> > > > times on dates that may occur on different days.
> > >
> > > > Thanks in advance
> > >
> > > > John
> > >
> > > Data fields:
> > > Date1
> > > Date2
> > > Time1
> > > Time2
> > >
> > > Date1 & Date 2 defined as Date fields, Time1 & Time2 defined as Time
> > > fields
> > >
> > > Calculation Field
> > >
> > > TimeDif =
> > > (Date2-Date1) *24*60*60
> > > +
> > > Time2-Time1
> > >
> > > TimeDIff field specified to give calculation result as Time
> > >
> > > You can of course multiply out 24*60*60 and use the result as a single
> > > multiplication factor.
> > >
> > > --
> > > Bill Collins
> > > For email, change "fake" to "earthlink"
> >
> > Thank you very much Bill
> >
> > Regards
> >
> > John
>
> If you are using 7 or better and just looking for number of hours
> between the two, you can use the timestamp function to combine the dates
> and times and do the heavy lifting:
>
> (Timestamp ( date1 ; time1 ) - Timestamp ( date2 ; time2 ))/3600
>
> result as a number