Re: Retrieve month from date - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: Retrieve month from date
Date
Msg-id 20070420123544.GG15322@a-kretschmer.de
Whole thread Raw
In response to Retrieve month from date  ("Rohit Khare" <rpk.general@gmail.com>)
List pgsql-sql
am  Fri, dem 20.04.2007, um 17:49:33 +0530 mailte Rohit Khare folgendes:
> I am using PGSQL 8.2.3 on Windows XP.
> 
> I have a table called "StudentFeesPayment" with columns "ReceiptNo" and
> "ReceiptMonthYear".
> The column, "ReceiptMonthYear" stores date in the format "yyyy-mm-dd". I have
> to find the max(ReceiptNo) where Month of (ReceiptMonthYear)=4. Or whatever
> month I give.
> 
> I tried:
> 
> Select max(ReceiptNo) from StudentFeesPayment where Extract(Month
> ('ReceiptMonthYear'))=4;
> 
> But it is not working. How to do it?

... where extract(month from "ReceiptMonthYear") = 4


Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: "Bart Degryse"
Date:
Subject: Re: Retrieve month from date
Next
From: Joe
Date:
Subject: Re: We all are looped on Internet: request + transport = invariant