View Single Post

   
  #3 (permalink)  
Old 04-24-2008, 07:17 PM
Bart Degryse
 
Posts: n/a
Default Re: First day of month, last day of month

select * from mytable where date_trunc('month', mydate) = date_trunc('month', now());


>>> Frank Bax <fbax@sympatico.ca> 2008-04-24 15:06 >>>

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());

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply With Quote