From: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
---|---|
To: | "Krog, Kenneth" <KAKrog(at)MassMutual(dot)com> |
Cc: | "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Working with dates and queries |
Date: | 2001-09-13 19:06:17 |
Message-ID: | Pine.BSF.4.21.0109131205100.37388-100000@megazone23.bigpanda.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Thu, 13 Sep 2001, Krog, Kenneth wrote:
> > I am attempting to do a query for a specific month based of a response for
> > a web site using php as the engine.
> > The syntax of the sql is simple
> >
> > "SELECT * FROM table WHERE MONTH(fieldname)=08;"
> >
> > note:
> > the fieldname is set to be a date field.
> >
> > Is this correct postgre syntax to find a date by month?
> >
> > If so: the fieldname I used was "date" since it is a researved word will
> > this cause problems?
> > If not what is the correct syntax?
I think this will work for you...
SELECT * FROM table WHERE
EXTRACT(MONTH FROM "date")=8;
From | Date | Subject | |
---|---|---|---|
Next Message | roypgsqlgen | 2001-09-13 19:30:01 | maintaining sequences |
Previous Message | Joe | 2001-09-13 18:50:26 | Make switches from gcc to cc Java is failing |