pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: [SQL] Date comparisons
4+ messages / 4 participants
[nested] [flat]

* Re: [SQL] Date comparisons
@ 1999-10-27 05:29 omid omoomi <oomoomi@hotmail.com>
  1999-10-27 14:28 ` Re: [SQL] Date comparisons Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 4+ messages in thread

From: omid omoomi @ 1999-10-27 05:29 UTC (permalink / raw)
  To: postgres@weblynk.com; pgsql-sql

hello ,try this :
select * from a where a.cdate < '10-20-1999' ;

regards,
omid omoomi


>From: Rich Ryan <postgres@weblynk.com>
>To: "pgsql-sql@postgresql.org" <pgsql-sql@postgreSQL.org>
>Subject: [SQL] Date comparisons
>Date: Tue, 26 Oct 1999 23:46:04 -0700
>
>I'm trying to do a > < on a date field. Not having any luck. My query looks
>like
>select * from a where a.cdate > Date('10-20-1999');
>I've tried every different date string format I can think of with no 
>dashes,
>colons, different orderings of the month, date, and year, etc. no luck. Any
>hints?
>Thanks,
>Rich
>
>
>
>************
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Date comparisons
  1999-10-27 05:29 Re: [SQL] Date comparisons omid omoomi <oomoomi@hotmail.com>
@ 1999-10-27 14:28 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 1999-10-27 14:28 UTC (permalink / raw)
  To: Thomas Lockhart <lockhart@alumni.caltech.edu>; +Cc: pgsql-sql; pgsql-bugs@postgreSQL.org

"omid omoomi" <oomoomi@hotmail.com> writes:
>> I'm trying to do a > < on a date field. Not having any luck.
>> My query looks like
>> select * from a where a.cdate > Date('10-20-1999');

> hello ,try this :
> select * from a where a.cdate < '10-20-1999' ;

Hoo boy, that looks like a nasty little bug.  The first example *should*
work, but indeed it does not.  Examination of the 'explain verbose'
output shows that the parser is converting the function call to
	datetime_date('10-20-1999'::unknown)
which is certainly not going to work --- datetime_date expects a
datetime input, not a text string.  I don't know why it's not choosing
to use date_in as the implementation of Date(), but in any case it
seems to have dropped the ball on coercing "unknown" to "datetime"
as it should have done if it wants to use datetime_date.

6.5.2 and current sources both misbehave like this.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Date comparisons
@ 1999-10-27 06:46 Rich Ryan <postgres@weblynk.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Rich Ryan @ 1999-10-27 06:46 UTC (permalink / raw)
  To: pgsql-sql

I'm trying to do a > < on a date field. Not having any luck. My query looks
like
select * from a where a.cdate > Date('10-20-1999');
I've tried every different date string format I can think of with no dashes,
colons, different orderings of the month, date, and year, etc. no luck. Any
hints?
Thanks,
Rich





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [SQL] Date comparisons
@ 1999-10-28 09:46 Haris Susanto <hariss@dnet.net.id>
  0 siblings, 0 replies; 4+ messages in thread

From: Haris Susanto @ 1999-10-28 09:46 UTC (permalink / raw)
  To: pgsql-sql-digest <pgsql-sql@hub.org>

psd> hello ,try this :
psd> select * from a where a.cdate < '10-20-1999' ;

psd> regards,
psd> omid omoomi

-----
Usually I use this :
select * from a where date_trunc('day',cdate) < '10-20-1999';


Best regards,
Haris                            mailto:hariss@dnet.net.id





^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-10-28 09:46 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-10-27 05:29 Re: [SQL] Date comparisons omid omoomi <oomoomi@hotmail.com>
1999-10-27 14:28 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-10-27 06:46 Date comparisons Rich Ryan <postgres@weblynk.com>
1999-10-28 09:46 Re: [SQL] Date comparisons Haris Susanto <hariss@dnet.net.id>

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