Re: [SQL] start and end of the week

2002-09-26 Thread Dmitry Tkach
Does any one know what is the reason not to put this logic into date_trunc () function? It seems to work with pretty much *any* unit imaginable, *except* for 'week'... Dima Bruno Wolff III wrote: > On Thu, Sep 26, 2002 at 11:55:48 -0400, > Jean-Luc Lachance <[EMAIL PROTECTED]> wrote: > >>How

Re: [SQL] start and end of the week

2002-09-26 Thread Bruno Wolff III
On Thu, Sep 26, 2002 at 11:55:48 -0400, Jean-Luc Lachance <[EMAIL PROTECTED]> wrote: > How about: > > select now() - date_part( 'DOW', now()) as starts_on, > now() -date_part( 'DOW', now()) + 6 as ends_on; That won't work in 7.3. The following works in both 7.2 and 7.3: area=> select curre

Re: [SQL] start and end of the week

2002-09-26 Thread Jean-Luc Lachance
How about: select now() - date_part( 'DOW', now()) as starts_on, now() -date_part( 'DOW', now()) + 6 as ends_on; "John Sebastian N. Mayordomo" wrote: > > How do I get the start and end date of the present week? > Is this possible? > > For example this week > Start = Sept. 22 > End = Sept

Re: [SQL] start and end of the week

2002-09-26 Thread Bruno Wolff III
On Thu, Sep 26, 2002 at 18:56:46 +0800, "John Sebastian N. Mayordomo" <[EMAIL PROTECTED]> wrote: > > > How do I get the start and end date of the present week? > Is this possible? > > For example this week > Start = Sept. 22 > End = Sept. 28 The following advice will work on 7.3. For 7.2.

[SQL] start and end of the week

2002-09-26 Thread Sebastian N. Mayordomo
How do I get the start and end date of the present week? Is this possible? For example this week Start = Sept. 22 End = Sept. 28 Thank you very much. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]