Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: sql query to find correct time diffrence
LPAD(TRUNC((((substr(end_time, 1, 2) * 60) + substr(end_time, 3, 2)) -
((substr(start_time, 1, 2) * 60) + substr(start_time, 3, 2)))/60) ,2,0) || LPAD(MOD((((substr(end_time, 1, 2) * 60) + substr(end_time, 3, 2)) - ((substr(start_time, 1, 2) * 60) + substr(start_time, 3, 2))) ,60),2,0)
I am doing this using the above.....
looking for a clean way of doing this... Thanks
fitzjarrell_at_cox.net wrote:
> Comments embedded.
> Jack wrote:
> > Hi,
> >
> > I have a table with 2 columns(varchar) end_time & start_time.
> > I have to write a query to find the correct diffrence of end_time &
> > start_time
>
> Then why are you asking US to write it?
>
> >
> > eg.
> > start_time end_time
> > 0830 1705
> >
> > the query should return ... 0835
> >
>
> Last I checked 17 hours and 5 minutes equals 16 hours and 65 minutes
> ...
> and I leave the rest up to you.
>
> > Thanks
>
> You're more than welcome, and I hope your homework gets completed on
> schedule.
>
>
> David Fitzjarrell
Received on Mon Dec 26 2005 - 08:21:33 CST
![]() |
![]() |