Re: Calendar Function

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Muhyiddin A(dot)M Hayat" <middink(at)indo(dot)net(dot)id>
Cc: Franco Bruno Borghesi <franco(at)akyasociados(dot)com(dot)ar>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Calendar Function
Date: 2005-02-02 03:45:35
Message-ID: 20050202034535.GA98781@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Wed, Feb 02, 2005 at 10:53:09AM +0800, Muhyiddin A.M Hayat wrote:
>
> But if i would like to display date in one Month,

You could use the given function with a few changes. For example,
given an arbitrary date, you could use date_trunc() to find the
first day of that date's month, add an interval of 1 month to find
the first day of the following month, and use a loop to return the
dates up to but not including the latter value.

For more information, see the "Date/Time Functions and Operators"
section in the "Functions and Operators" chapter of the documentation:

http://www.postgresql.org/docs/8.0/static/functions-datetime.html

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Peter Manchev 2005-02-02 13:57:10 plpgsql functions to 'C' functions
Previous Message Bradley Miller 2005-02-02 03:03:58 Re: Calendar Function