Received: from www.invert.com (invert.com [209.164.21.15]) by hub.org (8.10.1/8.11.0) with ESMTP id e9R7Heq61425 for ; Fri, 27 Oct 2000 03:17:40 -0400 (EDT) (envelope-from mee@www.invert.com) Received: (from mee@localhost) by www.invert.com (8.10.1/8.10.1AA) id e9R7Hd030543 for pgsql-php@postgresql.org; Fri, 27 Oct 2000 00:17:39 -0700 (PDT) (envelope-from mee) Date: Fri, 27 Oct 2000 00:17:39 -0700 From: Mike E To: pgsql-php@postgresql.org Subject: Time Difference Message-ID: <20001027001739.E28299@quidquam.com> Mail-Followup-To: pgsql-php@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Archive-Number: 200010/46 X-Sequence-Number: 61 I have the following setup: appt=# select * from availability \g emp_id | date | start_time | end_time --------+------------+------------+---------- 1 | 2000-10-30 | 08:00:00 | 14:30:00 appt=# select * from appointments \g start_time | end_time | emp_id | cus_id | services | date ------------+----------+--------+--------+----------+------------ 09:00:00 | 11:30:00 | 1 | 2 | {1,2,3} | 2000-10-30 Now, what I would like to get is the following: start_time | end_time ------------+---------- 08:00:00 | 09:00:00 11:30:00 | 14:30:00 I'm trying to generate a result set of all the free time slots in availability by taking the difference of the two. I've so far been unable to generate anything that works. Is this possible? Mike -- Mike Erickson http://www.quidquam.com/ "Hatred is the coward's revenge for being intimidated" - George Bernard Shaw