|
Posted by Ed Murphy on 09/19/07 14:32
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
Navigation:
[Reply to this message]
|