>
>Yes, the period can exceed 12 hours, so what you are saying is that this
>is not possible to solve without the date part? I can write this logic in
>my business logic but I was hoping to solve this in my database layer... BTJ
How about SELECT CASE WHEN "StartTime" > "EndTime" THEN
'23:59:99.99999999999'::time - "StartTime" + "EndTime" ELSE
"EndTime"-"StartTime" END FROM "TimeTable";
--- Adam Kavan
--- akavan(at)cox(dot)net