Re: using dates in pgsql - Mailing list pgsql-novice

From Ron Johnson
Subject Re: using dates in pgsql
Date
Msg-id 1062061562.25752.170.camel@haggis
Whole thread Raw
In response to Re: using dates in pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: using dates in pgsql
List pgsql-novice
On Wed, 2003-08-27 at 23:28, Tom Lane wrote:
> JohnH <JohnH@atkgib.com.au> writes:
> > But I want to use a variable in the WHERE option
> > WHERE  activedate < (current date less 188 days)
>
> You're going to be embarrassed...
>
> WHERE  activedate < (CURRENT_DATE - 188)

How does pg know that that's 188 days, and not months or years?

--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

"You ask us the same question every day, and we give you the
same answer every day. Someday, we hope that you will believe us..."
U.S. Secretary of Defense Donald Rumsfeld, to a reporter


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: using dates in pgsql
Next
From: Stuart Woodward
Date:
Subject: From which version was DROP ... CASCADE supported?