Skip site navigation (1) Skip section navigation (2)

Re: substring ..

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jeff MacDonald <jeff(at)hub(dot)org>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: substring ..
Date: 2000-12-19 20:07:33
Message-ID: Pine.BSF.4.21.0012191205580.77350-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-sql
On Tue, 19 Dec 2000, Jeff MacDonald wrote:

> hi folks..
> 
> 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
> 
> any clues ?

My guess is that it's a trailing space thing.  '2000-12-14' is
only 10 characters not 11...  What you're actually getting is
probably '2000-12-14 '



In response to

pgsql-sql by date

Next:From: Joel BurtonDate: 2000-12-19 20:08:14
Subject: Re: substring ..
Previous:From: Josh BerkusDate: 2000-12-19 20:06:14
Subject: Re: substring ..

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group