X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A0BB29DCBB4 for ; Tue, 28 Feb 2006 14:16:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80080-10 for ; Tue, 28 Feb 2006 14:16:29 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web60214.mail.yahoo.com (web60214.mail.yahoo.com [209.73.178.117]) by postgresql.org (Postfix) with SMTP id EA5769DCB5D for ; Tue, 28 Feb 2006 14:16:26 -0400 (AST) Received: (qmail 39526 invoked by uid 60001); 28 Feb 2006 18:16:26 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=4AIVO9poKKhvBt34b7pR1wErPeXuVBgYkMX3I/qOrHYuVyoHR5+Kij9KJGX+eadJFbOUVH+pipNaE36pXnHfod88xq42e1UGItcHAGELxRisRnsTz+hnuqkthxfSnjwBepT0VyZc5TFxATba8eQyFBcunhpRnO3FcJ5AlpK0N9s= ; Message-ID: <20060228181626.39524.qmail@web60214.mail.yahoo.com> Received: from [212.110.79.198] by web60214.mail.yahoo.com via HTTP; Tue, 28 Feb 2006 10:16:26 PST Date: Tue, 28 Feb 2006 10:16:26 -0800 (PST) From: Jovan Kostovski Subject: selecting records by timestamp (date) To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-483084940-1141150586=:38148" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.359 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_WHOIS=0.879, HTML_MESSAGE=0.001] X-Spam-Score: 1.359 X-Spam-Level: * X-Archive-Number: 200602/31 X-Sequence-Number: 3447 --0-483084940-1141150586=:38148 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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, CONSTRAINT 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 makes sharing a breeze. --0-483084940-1141150586=:38148 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit  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 makes sharing a breeze. --0-483084940-1141150586=:38148--