John Gedeon wrote:
> I have two date and time fields, start and end. I want find the difference 
> and i want to display the difference as days:hrs:mins:secs what is the best 
> way to do that... ?
> 
> Right now i use hour minute and second (built in functions) and those work 
> find for differences less than one day but they do not display the correct 
> amount of hours for differences longer than 1 day...
> any suggestions

SELECT
        CAST(
                (
                EXTRACT(DAY FROM (end - start)) || ':' ||
                EXTRACT(HOUR FROM (end - start)) || ':' ||
                EXTRACT(MINUTE FROM (end - start)) || ':' ||
                EXTRACT(SECOND FROM (end - start))
                ) AS VARCHAR)
FROM
        table

Jochem

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to