Re: [SQL] Retrieve month from date in SQl query

2007-04-23 Thread Michael Fuhr
On Wed, Apr 18, 2007 at 10:36:14AM -0700, RPK wrote: > I have a table called "StudentFeesPayment" with columns "ReceiptNo" and > "ReceiptMonthYear". > The column, "ReceiptMonthYear" stores date in the format "-mm-dd". I > have to find the max(ReceiptNo) where Month of (ReceiptMonthYear)=4. Or >

[SQL] Retrieve month from date in SQl query

2007-04-22 Thread RPK
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 "-mm-dd". I have to find the max(ReceiptNo) where Month of (ReceiptMonthYear)=4. Or whatever month I give.