Re: Re: First Saturday and Last Saturday of a month - Mailing list pgsql-general

From Allan Engelhardt
Subject Re: Re: First Saturday and Last Saturday of a month
Date
Msg-id 3B722F5A.68143B1E@cybaea.com
Whole thread Raw
In response to First Saturday and Last Saturday of a month  ("Brian C. Doyle" <bcdoyle@mindspring.com>)
List pgsql-general
Tom Lane wrote:

> Allan Engelhardt <allane@cybaea.com> writes:
> > Last Saturday problem is similar to above except for some sign
> > reversals, but more interesting as you need the number of days in the
> > month.
>
> I'd be inclined to take the first day of the *next* month (relatively
> easy to figure), and then back up to a Saturday using the 'dow' value
> for that day.

I *knew* there had to be a better way, even if I couldn't think of it late last night :-)

Thanks, Tom.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: First Saturday and Last Saturday of a month
Next
From: Nicholas Piper
Date:
Subject: optimisation of outer join