pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Muhyiddin A.M Hayat <middink@indo.net.id>
Cc: Franco Bruno Borghesi <franco@akyasociados.com.ar>
Cc: pgsql-sql@postgresql.org
Subject: Re: Calendar Function
Date: Tue, 1 Feb 2005 20:45:35 -0700
Message-ID: <20050202034535.GA98781@winnie.fuhr.org> (raw)
In-Reply-To: <018901c508d2$55bc3800$1f00a8c0@middinks>
References: <03a001c50545$6bd942d0$1f00a8c0@middinks>
	<41FA5E6A.50002@akyasociados.com.ar>
	<018901c508d2$55bc3800$1f00a8c0@middinks>

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/



view thread (6+ messages)  latest in thread

Message-ID: <20050202034535.GA98781@winnie.fuhr.org>
Permalink:  ../20050202034535.GA98781@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20050202034535.GA98781@winnie.fuhr.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mike@fuhr.org, middink@indo.net.id, franco@akyasociados.com.ar
  Subject: Re: Calendar Function
  In-Reply-To: <20050202034535.GA98781@winnie.fuhr.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox