Received: from webmail.parks.lv (mail@smtp.parks.lv [195.2.96.248]) by hub.org (8.10.1/8.10.1) with ESMTP id e67J78W89846 for ; Fri, 7 Jul 2000 15:07:09 -0400 (EDT) Received: from sandis ([195.2.123.209]) by webmail.parks.lv (8.9.3/8.9.3) with SMTP id VAA29985 for ; Fri, 7 Jul 2000 21:07:07 +0200 Message-ID: <005a01bfe83e$4fc52600$d17b02c3@mediaparks.lv> From: "sandis" To: Subject: date comparision Date: Fri, 7 Jul 2000 21:07:41 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-4" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200007/85 Is anyone out here can give some advice? i have a table with a timestamp field. i should know if there is records for the particular year and month so i need a query like (in MySQL it was very simple, but i should move to postgres!): SELECT something FROM mytable WHERE MONTH('timestamp_field')=07 AND YEAR('timestamp_field')=2000 LIMIT 1; So, i am looking for date/time functions: SELECT * FROM table WHERE date_part('year',timestamp 'timestamp_field') = 2000; but it doesn't work...(ERROR: Bad abstime external representation 'timestamp_field') may be i need subselect or abstime(timestamp) function?? I suppose it's a lame q, but i cannot solve it today... Thanks!