Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B76B1475C85 for ; Sun, 6 Oct 2002 11:37:42 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 51626475C5F for ; Sun, 6 Oct 2002 11:37:42 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id E0DDD381694; Sun, 6 Oct 2002 11:37:40 -0400 (EDT) From: "Brian Ward" X-Newsgroups: comp.databases.postgresql.sql Subject: Need some SQL help Date: Sun, 6 Oct 2002 11:41:46 -0400 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 14 Message-ID: X-Complaints-To: news@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/85 X-Sequence-Number: 9803 I have a table id int status int create_dt datetime When users log in and out I insert a row into this table throughout the day. I'm trying though to come up with a querie to tell me and ordering of users as they report in in the morning so i'm trying to say select each user and the earliest time the logged in in a give day, then order that by the create_dt column. Having trouble writing the SQL though