Re: First day of month, last day of month

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: "'Scott Marlowe'" <scott(dot)marlowe(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: First day of month, last day of month
Date: 2008-04-24 16:07:19
Message-ID: 024501c8a625$4590fdf0$8f01010a@iptel.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> -----Mensaje original-----
> De: Scott Marlowe [mailto:scott(dot)marlowe(at)gmail(dot)com]
>
>
> Note that if you are storing your time stamp as timestamptz,
> you can use the "at time zone 'xyz'" construct to create an
> index, and as long as you retrieve them with the same
> construct you'll get to use the index.
>
> create index test_ts_month_trunc on testtable
> (date_trunc('month',(ts at time zone 'MST')));
> select * from testtable
> where date_trunc('month',(ts at time zone 'MST'))='2007-10-01
00:00:00'::timestamp;
>

I see the point. Thanks for the elaboration.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tarlika Elisabeth Schmitz 2008-04-24 16:12:41 Re: extracting words
Previous Message Scott Marlowe 2008-04-24 15:44:44 Re: First day of month, last day of month