Subject | Re: difference between TIMESTAMPs |
---|---|
Author | Ali Gökçen |
Post date | 2006-04-19T11:09:04Z |
Here is more simply way:
cast((checkout-checkin) as integer ) gives number of days.
(checkout-checkin)-days gives oneday/84000 (remainderrate, rr)
(a day is 84000 seconds)
so rr*84000 gives remainder time in seconds, rt.
cast('00:00' as time) + rt gives in TIME display format without
overflow risk!
Regards.
Ali
--- In firebird-support@yahoogroups.com, Ali Gökçen <ali_gokcen@...>
wrote:
cast((checkout-checkin) as integer ) gives number of days.
(checkout-checkin)-days gives oneday/84000 (remainderrate, rr)
(a day is 84000 seconds)
so rr*84000 gives remainder time in seconds, rt.
cast('00:00' as time) + rt gives in TIME display format without
overflow risk!
Regards.
Ali
--- In firebird-support@yahoogroups.com, Ali Gökçen <ali_gokcen@...>
wrote:
>TOTAL
> Ops to me!
> i forgot to convert difference of timestamps to seconds before
> calculation.
> I leaved this industry last week,
> how human brain have tendecy to forget. :)
>
> --- In firebird-support@yahoogroups.com, Ali Gökçen <ali_gokcen@>
> wrote:
> >
> > hey hey... relax Martijn,
> > i don't want another fighting over time issue.. ;)
> >
> > Hi dude,
> > TIMESTAMP is a time-detailed calendar data format.
> > Can you represent difference of two calendartimes as in calender
> > format?
> > No, of course.
> >
> > But you can display it in human readable format:
> >
> > (checkout-checkin)/84000 gives you the number of days delta.
> >
> > cast('00:00' + ((checkout-checkin)-(days*84000)) as time)
> >
> > gives you remainder time value in time display format.
> >
> > As you see, there is two result and usage of them is up to u.
> >
> > Regards.
> > Ali
> >
> >
> >
> > --- In firebird-support@yahoogroups.com, "d_dude_2003"
> > <d_dude_2003@> wrote:
> > >
> > > I have two TIMESTAMP fields CHECKIN and CHECKOUT...I need to
> > calculate
> > > the duration between them to use in report and also get a
> of
> > all
> > > durations...
> > >
> > > How do i SELECT a duration in propert format, like 01:20...
> > >
> > > I tried CAST(CHECKOUT - CHECKIN AS TIMESTAMP) but i have
> conversion
> > > error...
> > >
> > > Thanks.
> > >
> >
>