Re: First day of month, last day of month

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: First day of month, last day of month
Date: 2008-04-24 13:06:25
Message-ID: 481085D1.2010807@sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Nacef LABIDI wrote:
> is there a better method to retrieve all
> the rows with dates in the current month.

select * from mytable where extract(month from mydate) = extract(month
from now()) and extract(year from mydate) = extract(year from now());

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bart Degryse 2008-04-24 13:11:03 Re: First day of month, last day of month
Previous Message Nacef LABIDI 2008-04-24 12:59:47 First day of month, last day of month