Search Postgresql Archives

Re: Problem with selecting the first day of the the week

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello
try
CREATE OR REPLACE FUNCTION public.fdow(date) RETURNS date LANGUAGE sql IMMUTABLE STRICTAS $function$ select $1 - extract(dow from $1)::int $function$
postgres=# select fdow(current_date);    fdow------------ 2008-10-26(1 row)
regardsPavel Stehule
2008/10/29 x asasaxax <xanaruto@xxxxxxxxx>:> Hi,>>    I need a function to select the first day of the week. For example> giving  today´s date(29/10/2008).>> Can anyone help´s me?> Thanks!>
-- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)To make changes to your subscription:http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux