X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 511173A43AA for ; Thu, 18 Nov 2004 20:57:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37084-03 for ; Thu, 18 Nov 2004 20:57:29 +0000 (GMT) Received: from mx-mtaout02.mts.net (wnpgmb02-group-smtpout.mts.net [142.161.130.102]) by svr1.postgresql.org (Postfix) with ESMTP id 8D1F23A47DD for ; Thu, 18 Nov 2004 20:57:29 +0000 (GMT) Received: from [192.168.0.9] ([207.161.203.27]) by mx-mtaout02.mts.net with ESMTP id <20041118205728.TNXQ1377.mx-mtaout02.mts.net@[192.168.0.9]> for ; Thu, 18 Nov 2004 14:57:28 -0600 Message-ID: <419D0DC6.5080504@candoltd.com> Date: Thu, 18 Nov 2004 15:01:58 -0600 From: Nick Peters User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Comparing Dates Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/180 X-Sequence-Number: 19499 Hey, I am trying to compare dates in a sql statement. this is what i have tried: SELECT * FROM transactions WHERE shippingdate>2004-06-08 AND transtype='Sale'; but it returns all rows. When i switch the > with a < it returns nothing. I have even tried with todays date and have got the same results. So i guess my question is how do i compare two dates? BTW the column by the name of shippingdate is a date data type with the same format as the dates show above. Thanks in advance. -Nick