Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 876EB862DB7 for ; Wed, 8 Feb 2012 16:01:53 -0400 (AST) Received: from smtp.comsquared.com ([209.155.237.140]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RvDiD-0007fl-08 for pgsql-sql@postgresql.org; Wed, 08 Feb 2012 20:01:53 +0000 Received: from mdpserv.comsquared.com (mdpserv [10.82.40.1]) by smtp.comsquared.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id q18K1ZmI012083 for ; Wed, 8 Feb 2012 15:01:38 -0500 (EST) Received: from erouse052008 ([10.82.60.61]) by mdpserv.comsquared.com (8.13.6+Sun/8.13.6) with ESMTP id q18K1Z03014909 for ; Wed, 8 Feb 2012 15:01:35 -0500 (EST) From: "Edward W. Rouse" To: Subject: time interval math Date: Wed, 8 Feb 2012 15:01:36 -0500 Message-ID: <032001cce69c$767bc010$63734030$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AczmnHY7gez/qTGBQw6T7hcMkEnHuQ== Content-Language: en-us X-Pg-Spam-Score: -0.0 (/) X-Archive-Number: 201202/23 X-Sequence-Number: 36316 I'm still working on getting this to work, but the summary is this: I am getting several (many) intervals of hour, minutes and seconds. I need a sum of the absolute value these intervals, similar to the SUM(ABS()) function for numbers; and I need to divide this sum by an integer (bigint). Getting the intervals is no problem, but I can't find built in functions for the rest. Currently on 8.3, want to upgrade to 9.x but I can't until this is finished. Do these functions exist, or will I be forced to convert to seconds, do the math and then convert back to hour-minute-second format (I am assuming from current data that, after the divide, the result should be in the minute: second range). Edward W. Rouse Comsquared System, Inc. 770-734-5301