Re: Week number

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Wodzu" <wodzu(at)wodzus(dot)prv(dot)pl>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Week number
Date: 2001-11-29 01:43:41
Message-ID: GNELIHDDFBOCMGBFGEFOMEJICAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In 7.1.x, try:

SELECT EXTRACT (WEEK FROM CURRENT_DATE);

in older postgres maybe this:

SELECT EXTRACT (WEEK FROM DATE 'today');

Chris

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of Wodzu
> Sent: Wednesday, 28 November 2001 8:10 PM
> To: pgsql-hackers(at)postgresql(dot)org
> Subject: [HACKERS] Week number
>
>
> Hi all,
>
> I'm novice in PostgreSQL.
> I want to obtain current week number.
> Under PHP I try:
>
> $query = "SELECT EXTRACT(WEEK FROM NOW)";
> $result= pg_exec($dbconn,$query);
>
> where: $dbconn - successful conection id
> But this give me an error message.
> Can somebody help me?
> Sorry for my english.
>
> Thanks in advice.
>
> Wodzu
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-11-29 01:47:05 Re: Week number
Previous Message Jim Buttafuoco 2001-11-29 01:37:18 Re: 7.2beta3 on Digital Alpha