Re: Re: First Saturday and Last Saturday of a month

From: Allan Engelhardt <allane(at)cybaea(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Brian C(dot) Doyle" <bcdoyle(at)mindspring(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: First Saturday and Last Saturday of a month
Date: 2001-08-09 06:36:10
Message-ID: 3B722F5A.68143B1E@cybaea.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:

> Allan Engelhardt <allane(at)cybaea(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2001-08-09 07:02:58 Re: Random strings
Previous Message Tom Lane 2001-08-09 02:18:47 Re: createdb confusion