Received: from olympus.scw.org (209-9-156-98.sdsl.cais.net [209.9.156.98]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBJK8D615522 for ; Tue, 19 Dec 2000 15:08:13 -0500 (EST) (envelope-from jburton@scw.org) Received: from zeus (zeus.scw.org [209.9.156.105]) by olympus.scw.org (8.10.1/8.10.1) with ESMTP id eBJK8E322196; Tue, 19 Dec 2000 15:08:14 -0500 Message-Id: <200012192008.eBJK8E322196@olympus.scw.org> From: "Joel Burton" Organization: Support Center of Washington To: Jeff MacDonald Date: Tue, 19 Dec 2000 15:08:14 -0500 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: substring .. CC: pgsql-sql@postgresql.org In-reply-to: X-mailer: Pegasus Mail for Win32 (v3.12a) X-Archive-Number: 200012/227 X-Sequence-Number: 564 > i want to do this to a datetime field.. > > select foo from table where substr(datefoo,1,11) = '2000-12-14'; > > it returns no results yet.. > > select substr(datefoo,1,11) does return some values that say > 2000-12-14 Ummm... because '2000-12-14' is a ten-character, not eleven character long string. Try substr(datefoo,1,10) and it works for me (under 7.1devel). However, this all seems sloppy. Why not extract the date, and compare it as a date? -- Joel Burton, Director of Information Systems -*- jburton@scw.org Support Center of Washington (www.scw.org)