Re: Week of the Year?

From: John McKown <jmckown(at)prodigy(dot)net>
To: PostgreSQL sql mailing list <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Week of the Year?
Date: 2000-08-12 13:50:04
Message-ID: Pine.LNX.4.21.0008120846500.16858-100000@linux2.johnmckown.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Sorry,
I don't speak TCL or TK. I've got a book on it, but I haven't had any time
or pressing need to get familiar with it. I'm learning Python & PHP. Well,
at least I'm trying to whenever I can find a spare moment (which is rare).

On Sat, 12 Aug 2000, David Lloyd-Jones wrote:

> John,
>
> Many thanks. What I actually need is to present the five weekdays of a week
> beginning with Sunday on a drop-down box in TCL; then have a person click on
> any day and get sales for that day, or on a thing at the bottom to get sales
> for the week
>
> Do you TCL? Can you give me any clues on drop-down boxes, and how to get
> the -U, Linux week-of-the-year, into them?
>
> Best wishes,
>
> -dlj.
>
> Hey, I didn't know Prodigy still existed!
>
>
>
>
>
> ----- Original Message -----
> From: "John McKown" <jmckown(at)prodigy(dot)net>
> To: "David Lloyd-Jones" <david(dot)lloyd-jones(at)attcanada(dot)ca>
> Cc: <pgsql-sql(at)postgresql(dot)org>
> Sent: Friday, August 11, 2000 10:55 PM
> Subject: Re: [SQL] Week of the Year?
>
>
> >
> > Try using the function date_part such as:
> >
> > select date_part('week',now());
> >
> > "and the days that are in that week" I guess want to answer a question
> > such as:
> > Given a date, what is first date in that same week, and what is the last
> > date in that week. There are a couple of approaches to this. My first was:
> >
> > select
> > to_date(date_part('year',now()),'YYYY')+(7*date_part('week',now()));
> >
> > and the above +6 to the the last day of the week. Another approach for
> > this same question is much simplier (if the question is indeed what you
> > are asking)
> >
> > select now()-date_part('dow',now());
> >
> > This last select gives the Sunday for the current week. To get the
> > Saturday, simply:
> >
> > select now()-date_part('dow',now())+6;
> >
> > Of course, replace the now() with whatever contains the date or timestamp.
> >
> > John McKown
> >
> > > I'm probably staring right at it. (One of the difficulties with RTFMing,
> is
> > > having too many docs!)
> > >
> > > Is there anything in the API that produces the week of the year, from 1
> to
> > > 52 or 53 depending on the week of the year, and the days that are in
> that
> > > week?
> > >
> > > Many thanks.
> > >
> > > -dlj.
> > >
> > >
> > >
> >
> >
>

Browse pgsql-sql by date

  From Date Subject
Next Message John McKown 2000-08-12 13:53:54 Re: Operator Precedence problem?
Previous Message Philip Warner 2000-08-12 05:49:18 Operator Precedence problem?