From: Joel Burton <jburton@scw.org>
To: Jeff MacDonald <jeff@hub.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: substring ..
Date: Tue, 19 Dec 2000 15:08:14 -0500
Message-ID: <200012192008.eBJK8E322196@olympus.scw.org> (raw)
In-Reply-To: <Pine.BSF.4.21.0012191505370.3386-100000@rage.hub.org>
> 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jburton@scw.org, jeff@hub.org
Subject: Re: substring ..
In-Reply-To: <200012192008.eBJK8E322196@olympus.scw.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox