Brian C. Doyle <[EMAIL PROTECTED]> wrote:
> I am working on a function to determine the date of the first saturday of
> the month.
>
> Currently I have:
>
> CREATE FUNCTION first_saturday(date)
> RETURNS date
> AS '
> Select CASE WHEN date_part(\'dow\',\'$1\'::DATE)=0 THEN date(\'$1\')+6
> WHE
The main reason is that I am not quering a table with it as of yet...
Ultimately it will before query that is a Month do date query that does not
use a calender month
At 05:29 PM 9/24/01 -0700, Randal L. Schwartz wrote:
> > "Brian" == Brian C Doyle <[EMAIL PROTECTED]> writes:
>
>Brian> Hell
> "Brian" == Brian C Doyle <[EMAIL PROTECTED]> writes:
Brian> Hello all,
Brian> I am working on a function to determine the date of the first saturday
Brian> of the month.
Brian> Currently I have:
Brian> CREATE FUNCTION first_saturday(date)
Brian> RETURNS date
Brian> AS '
Brian> Select CASE
That was it... I knew it was something simple.. Thanks Peter!!!
At 11:06 PM 9/24/01 +0200, Peter Eisentraut wrote:
>Brian C. Doyle writes:
>
> > CREATE FUNCTION first_saturday(date)
> > RETURNS date
> > AS '
> > Select CASE WHEN date_part(\'dow\',\'$1\'::DATE)=0 THEN date(\'$1\')+6
> > WHEN date
Brian C. Doyle writes:
> CREATE FUNCTION first_saturday(date)
> RETURNS date
> AS '
> Select CASE WHEN date_part(\'dow\',\'$1\'::DATE)=0 THEN date(\'$1\')+6
> WHEN date_part(\'dow\',\'$1\'::DATE)=1 THEN date(\'$1\')+5
> WHEN date_part(\'dow\',\'$1\'::DATE)=2 THEN date(\'$1\')+4
> WHEN date_part(\