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 D407C9DC80C for ; Mon, 27 Feb 2006 20:12:29 -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 29619-09 for ; Mon, 27 Feb 2006 20:12:32 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web60216.mail.yahoo.com (web60216.mail.yahoo.com [209.73.178.104]) by postgresql.org (Postfix) with SMTP id 32DB09DC800 for ; Mon, 27 Feb 2006 19:46:15 -0400 (AST) Received: (qmail 28581 invoked by uid 60001); 27 Feb 2006 23:46:14 -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=wXmQ+QOLElO0RMV/5V0BY21GJwLsWQFllkO7mcuJ4an6YpX1s1fXt25BGqP/dt+VfAttdOwf3mYbxf63y9QTykl4QESvdu0U4FxUjnpDOebzwHO3nX2Jni+fThVo+Vv77WxY225yeMbJ5/0oJoU6qi14bI49MPnTbQ5gPC+uYxs= ; Message-ID: <20060227234614.28579.qmail@web60216.mail.yahoo.com> Received: from [194.149.128.240] by web60216.mail.yahoo.com via HTTP; Mon, 27 Feb 2006 15:46:14 PST Date: Mon, 27 Feb 2006 15:46:14 -0800 (PST) From: Jovan Kostovski Subject: Selecting by date (timestamp) To: pgsql-php@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1781307543-1141083974=:27486" 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/34 X-Sequence-Number: 3450 --0-1781307543-1141083974=:27486 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? 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-1781307543-1141083974=:27486 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,
      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?

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-1781307543-1141083974=:27486--