Received: from caroubier.wanadoo.fr (smtp-rt-6.wanadoo.fr [193.252.19.160]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA80566 for ; Sat, 3 Jun 2000 16:00:41 -0400 (EDT) (envelope-from T.J.Farrell@wanadoo.fr) Received: from antholoma.wanadoo.fr (193.252.19.153) by caroubier.wanadoo.fr; 3 Jun 2000 22:00:39 +0200 Received: from oemcomputer (193.250.184.3) by antholoma.wanadoo.fr; 3 Jun 2000 22:00:36 +0200 Message-ID: <000c01bfcd96$cab4d3a0$03b8fac1@oemcomputer> From: "T.J.Farrell" To: Subject: Update table: extract max(hour). Date: Sat, 3 Jun 2000 22:02:43 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Archive-Number: 200006/27 Hello, I am trying to update one table based on another table data as follows: TableStatus containts fields date (date), hour (time), IDcode (text), status (text). TableProduct contains fields state (text), datestate (date), IDcode (text). I want to update state and datestate based on the last status in Tablestatus. The problem is that I cannot extract a max(hour) from PG, and using max(date) is not sufficient, as 2 status could be entered on the same day on two different times. I am unsure how to resolve this problem. TIA