Received: from shark.x9media.com ([62.104.116.95]) by hub.org (8.9.3/8.9.3) with ESMTP id JAA53751 for ; Sat, 28 Aug 1999 09:19:23 -0400 (EDT) (envelope-from frank@x9media.com) Received: (from frank@localhost) by shark.x9media.com (8.8.7/8.8.7) id PAA18910 for pgsql-sql@postgreSQL.org; Sat, 28 Aug 1999 15:35:08 +0200 Date: Sat, 28 Aug 1999 15:35:07 +0200 From: Frank Joerdens To: pgsql-sql@postgreSQL.org Subject: datetime query issue Message-ID: <19990828153506.A18896@shark.x9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i I'm not sure how to go about this: I want to find all rows with a timestamp between, say 6 a.m. and 10 p.m. for any number of days. The column format is datetime. How do I extract the 'time of the day' information from this column? What I can think of is to create a view for every single day where datetime is > 6 and < 10 and then another query on all views together but that doesn't sound very elegant and would be a real memory hog for a large number of days. Any better ideas? Thanks Frank