Re: [GENERAL] How to get number of the week from datetime?

From: Jose Soares <jose(at)sferacarta(dot)com>
To: "Hojdar Karel Ing(dot)" <karel(dot)hojdar(at)synergie(dot)cz>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [GENERAL] How to get number of the week from datetime?
Date: 2000-01-14 17:14:27
Message-ID: 387F5973.12A8D4C5@sferacarta.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Hojdar Karel Ing." wrote:

> Hi,
>
> how I can get some agregates (avg, min, max) for whole week (in specified
> year)?
> For example from table with two columns : time datetime and value float8.
> And I want to get average of value based on whole weeks. If I try to use
> date_part('week',time) - Postgresql doesn't recognize word 'week'.
>
> Thanks Karel
>
> ************

select date_part('dow',current_date);

If you are looking for a function to calculate the no. week of the year...
try the attached function.

José

Attachment Content-Type Size
week.sql text/plain 1.4 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Compte utilisateur Sultan-advl 2000-01-14 18:00:08 Re: [INTERFACES] psql ERROR : Character Types Tuple is too big: size xxxxx
Previous Message Bruce Momjian 2000-01-14 16:43:37 Re: Oids vs Serial fields (was Re: [GENERAL] searching oid's)