Re: Retrieve month from date

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Retrieve month from date
Date: 2007-04-20 12:35:44
Message-ID: 20070420123544.GG15322@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Joe 2007-04-20 12:42:58 Re: We all are looped on Internet: request + transport = invariant
Previous Message Bart Degryse 2007-04-20 12:29:07 Re: Retrieve month from date