Re: How to find out the weekday from a date???

From: Ryan Mahoney <ryan(at)paymentalliance(dot)net>
To: Jose Manuel Lorenzo Lopez <jose-manuel(dot)lorenzo-lopez(at)ica(dot)conti(dot)de>, PGSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to find out the weekday from a date???
Date: 2001-07-17 14:56:31
Message-ID: 5.0.2.1.0.20010717105523.02a17670@paymentalliance.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am not sure how to do this in PostgreSQL, but if you are using PHP to
commincate with your database, you can use PHP's rich set of date
conversion function to do this and many other things.

Good Luck

-r

At 04:24 PM 7/17/01 +0200, Jose Manuel Lorenzo Lopez wrote:

>Hello PG's,
>
>I want to extract the weekday of a given 'date' type field in my table
>when selecting. How can I do this?
>
>For example in a table "bschft_days" filled with values with type 'date'
>
>I want to select all the days within the month 'march' and output the
>respective
>weekday. I tryed this:
>
>select extract(dow from timestamp(day)), day, userid from bschft_days
>where date_part('month', day) = '3';
>
>But it only tells me:
>
>ERROR: parser: parse error at or near "dow"
>
>:(
>
>Any ideas??
>
>Thanks a lot in advance!
>
>Best Regards / Mit freundlichen Grüßen / Un saludo
>
>José Manuel lorenzo López
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>http://www.postgresql.org/users-lounge/docs/faq.html
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.251 / Virus Database: 124 - Release Date: 4/26/01

Attachment Content-Type Size
unknown_filename text/plain 166 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Lockhart 2001-07-17 14:59:33 Re: How to find out the weekday from a date???
Previous Message Mitch Vincent 2001-07-17 14:50:33 Re: How to find out the weekday from a date???