For some reason this doesn't give me satisfaction that it's written
optimally, but I haven't found another way.

  SELECT round(CAST ((EXTRACT(EPOCH FROM clockout)
              -EXTRACT(EPOCH FROM clockin))/3600 AS NUMERIC),2) AS hours
    FROM timeclock;

The clockin and clockout columns are of type timestamp.

Is there a faster way to achieve this?  If not faster, a cleaner way
that executes as fast?


-- 
Brandon

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to