pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rodrigo Llanos <rodrigollanos@gmail.com>
To: pgsql-php@postgresql.org
Subject: Re: selecting records by timestamp (date)
Date: Tue, 28 Feb 2006 16:51:01 -0300
Message-ID: <f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com> (raw)
In-Reply-To: <20060228181626.39524.qmail@web60214.mail.yahoo.com>
References: <20060228181626.39524.qmail@web60214.mail.yahoo.com>

maybe the postgres version in the server is different

On 2/28/06, Jovan Kostovski <chom_devel@yahoo.com> wrote:
>
>  Hi,
>
> I have the following table running on postgres 8.04:
>
>    CREATE TABLE ValueLog
>     (
>       idValueLog int4 NOT NULL DEFAULT nextval ('
> public.idValueLog_seq'::text),
>       PPx integer,
>       iValue integer DEFAULT -1,
>       fValue real DEFAULT -1,
>       t_tag timestamp without time zone,
>       t_arr timestamp without time zone,
>       cot integer,
>       ack boolean,
>       blk boolean,
>       qd_iv boolean,
>       qd_nt boolean,
>       qd_sb boolean,
>       qd_bl boolean,
>       qd_ov boolean,
>       CONSTR AINT idValueLog PRIMARY KEY (idValueLog)
>     )
>         WITHOUT OIDS;
>         ALTER TABLE ValueLog OWNER TO $admin_user;"
>
> I've created the following SQL statement to select the records newer then
> a given date:
>
> select almvalue.almname , ppoint.ppdimstr, valuelog.ack, valuelog.blk,
> to_char(valuelog.t_arr,'DD.MM.YYYY HH24:MI:SS') from ppoint, valuelog,
> almvalue where ppoint.ppx = valuelog.ppx and almvalue.almvalue =
> valuelog.ivalue and valuelog.ppx = $db_ppx and  to_char(valuelog.t_arr,'YYYYMMDD')
> >= '$ts
>
> $ts is a string, the date value input by the user and formated YYYYMMDD
>
> I've developed the web site on my Ubuntu box, but when I uploaded the site
> on the server Fedora Core 3, I had problems with the date filtering. Running
> psql on the server I've noticed that there were more data in the select *
> from  value log results, field t_arr something like MM-DD-YYYY-dsfsdfd
> (something else which I don't know what it is)
> I think that the local time settings on the server makes me the troubles.
>
> What's the solution?
>
> I've even checked the result  of:
> select to_char(valuelog.t_arr,'DD.MM.YYYY HH24:MI:SS') from  valuelog;
>
> but instead of data I got empty data set. Why?
>
> What's the best way to do filtering (selecting) data by time?
>
> TIA, Jovan
>
> ------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail
> <http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=39174/*http://photomail.mail.yahoo.com>makes sharing a breeze.
>



--
Atte. Rodrigo A. Llanos N.

Saludos.

view thread (3+ messages)  latest in thread

Message-ID: <f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com>
Permalink:  ../f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com/
Also on:    postgresql.org/message-id/f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: rodrigollanos@gmail.com
  Subject: Re: selecting records by timestamp (date)
  In-Reply-To: <f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com>
  References: <20060228181626.39524.qmail@web60214.mail.yahoo.com> <f08928a80602281151q6df9d77brab351b6e0e4b6ac7@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox