Skip site navigation (1) Skip section navigation (2)

Re: Create Calendar

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Muhyiddin A(dot)M Hayat" <middink(at)indo(dot)net(dot)id>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Create Calendar
Date: 2004-12-11 04:11:52
Message-ID: 20041211041152.GA63199@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-sql
On Sat, Dec 11, 2004 at 03:26:33AM +0800, Muhyiddin A.M Hayat wrote:

> How to create Calendar using Function/View. 
> For example i would like to display date 2004-12-01 to 2004-12-20. 

You could write a function that returns SETOF DATE.  Some sections
of the documentation you'll want to study are:

"Data Types" chapter, "Date/Time Types" section

"Functions and Operators" chapter, "Date/Time Functions and
Operators" section

"PL/pgSQL - SQL Procedural Language" chapter, especially the
"Control Structures" section

If you have trouble then please post what you've tried with an
explanation of how you'd like it to work and a description of
what actually happens.

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

In response to

pgsql-sql by date

Next:From: Kenneth GonsalvesDate: 2004-12-11 05:00:55
Subject: replacing mysql enum
Previous:From: Stephan SzaboDate: 2004-12-11 02:28:38
Subject: Re: Query is not using index when it should

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group