X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id F3CE59FB1C8 for ; Sun, 17 Sep 2006 07:03:00 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 37949-01 for ; Sun, 17 Sep 2006 10:02:51 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mx1.ipf.is (mack.ipf.is [85.197.192.164]) by postgresql.org (Postfix) with ESMTP id 9FF6F9FB1BA for ; Sun, 17 Sep 2006 07:02:50 -0300 (ADT) Received: (qmail 26024 invoked by uid 1010); 17 Sep 2006 10:02:23 +0000 Received: from 88.149.106.19 by mack (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(0.0/4.5):. Processed in 0.278495 secs); 17 Sep 2006 10:02:23 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via mack X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(0.0/4.5):. Processed in 0.278495 secs Process 26017) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx1.ipf.is with SMTP; 17 Sep 2006 10:02:22 +0000 Subject: Re: Dividing results from two tables with different time From: Ragnar To: Becky Hoff Cc: pgsql-sql@postgresql.org In-Reply-To: <4B2BD8A084A0B442ABF42645DB572A5F28DD4D@fr-fs1.StandonInc.com> References: <4B2BD8A084A0B442ABF42645DB572A5F28DD4D@fr-fs1.StandonInc.com> Content-Type: text/plain; charset=iso-8859-13 Date: Sun, 17 Sep 2006 10:05:50 +0000 Message-Id: <1158487550.659.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/115 X-Sequence-Number: 26326 On fös, 2006-09-15 at 10:34 -0500, Becky Hoff wrote: > I hope I can explain this clearly. Not clear enough for me. > I have two queries Iÿm running in a report. > The first one is: [snip] > No matter which query I place them in it gives me the wrong data > because of the time frames. How can I get the correct > data? It is not clear what you consider correct data. I suggest you devise a simple test case, with just the minimum number of tables and columns needed to explain your problem, show us a small data set and describe your wanted output. For example, avoid joins in your test case, unless they are central to your problem gnari