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

Comparison of dates

From: "Ing(dot) Sergio Lima" <slima(at)cet-gt(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Comparison of dates
Date: 2007-04-25 05:33:04
Message-ID: 002501c786fb$342b8890$0500000a@dell (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Hi!! I am using postgresql 7.3 and I have a table with one timestamp without zone field (date1), I want to select any row when "date1" is between inicial_date and final_date values, I'm using an Sql sentence like this:

SELECT name, date1, ......
FROM table_name
WHERE date1>=inicial_date and date1<=final_date

it works fine if month of field "date1" is the same in "inicial_date" and "final_date", but if month value of "date1" is different the result is always NULL, any idea??????

please help me!!!


pgsql-novice by date

Next:From: henlinDate: 2007-04-25 09:08:15
Subject: delete non-unique
Previous:From: A. KretschmerDate: 2007-04-24 18:56:13
Subject: Re: File I/O

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