Afficher un message
Vieux 19/09/2007, 15h32   #5
Ed Murphy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: time conversion hiccup

DonLi2006@gmail.com wrote:

> ahe, I spoke a bit too soon, new prob.
> data sets:
> start stop
> 19:30 02:15 (next day morning)
> 26:15 (invalid hh:mm time range)
>
> CASE WHEN (datediff(n,start,stop) < 0) THEN 0 END


Assuming that the stop time is always within 24 hours after the
start time:

case
when datediff(n,start,stop) < 0
then datediff(n,start,stop) + 1440 -- minutes per day
else datediff(n,start,stop)
end
  Réponse avec citation
 
Page generated in 0,04420 seconds with 9 queries