Thread: Query with error - DOW FROM timestamp

Query with error - DOW FROM timestamp

From
"Victor Sterpu"
Date:
Hello
 
When I run the query from down I receive an error.
How can I write this query to receive the day ot the week.
SELECT EXTRACT(DOW FROM timestamp TO_TIMESTAMP('14-10-2011',  'DD-MM-YYYY'));
 
Thank you

DISCLAIMER:
Acest mesaj de posta electronica si documentele aferente sunt confidentiale. Este interzisa distribuirea, dezvaluirea sau orice alt mod de utilizare a lor. Daca nu sunteti destinatarul acestui mesaj, este interzis sa actionati in baza acestor informatii. Citirea, copierea, distribuirea, dezvaluirea sau utilizarea in alt mod a informatiei continute in acest mesaj constituie o incalcare a legii. Daca ati primit mesajul din greseala, va rugam sa il distrugeti, anuntand expeditorul de eroarea comisa. Intrucat nu poate fi garantat faptul ca posta electronica este un mod sigur si lipsit de erori de transmitere a informatiilor, este responsabilitatea dvs. sa va asigurati ca mesajul (inclusiv documentele alaturate lui) este validat si autorizat spre a fi utilizat in mediul dvs.

Re: Query with error - DOW FROM timestamp

From
Albe Laurenz
Date:
Victor Sterpu wrote:
> When I run the query from down I receive an error.
> How can I write this query to receive the day ot the week.
> SELECT EXTRACT(DOW FROM timestamp TO_TIMESTAMP('14-10-2011',  'DD-MM-YYYY'));

Maybe you mean

SELECT EXTRACT(DOW FROM TO_TIMESTAMP('14-10-2011', 'DD-MM-YYYY'));

Yours,
Laurenz Albe

Re: Query with error - DOW FROM timestamp

From
"Victor Sterpu"
Date:
  Yes, thank you.

------ Original Message ------
From: "Albe Laurenz" <laurenz.albe@wien.gv.at>
To: "Victor Sterpu" <victor@caido.ro>; "PostgreSQL General"
<pgsql-general@postgresql.org>
Sent: 5/23/2014 12:51:30 PM
Subject: RE: [GENERAL] Query with error - DOW FROM timestamp

>Victor Sterpu wrote:
>>  When I run the query from down I receive an error.
>>  How can I write this query to receive the day ot the week.
>>  SELECT EXTRACT(DOW FROM timestamp TO_TIMESTAMP('14-10-2011',
>>'DD-MM-YYYY'));
>
>Maybe you mean
>
>SELECT EXTRACT(DOW FROM TO_TIMESTAMP('14-10-2011', 'DD-MM-YYYY'));
>
>Yours,
>Laurenz Albe