Selecting by date (timestamp)
am 28.02.2006 00:46:14 von Jovan Kostovski--0-1781307543-1141083974=:27486
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
I have the following table running on postgres 8.04:
CREATE TABLE ValueLog=20
(=20
idValueLog int4 NOT NULL DEFAULT nextval ('public.idValueLog_seq'::=
text),=20
PPx integer,=20
iValue integer DEFAULT -1,=20
fValue real DEFAULT -1,=20
t_tag timestamp without time zone,=20
t_arr timestamp without time zone,=20
cot integer,=20
ack boolean,=20
blk boolean,=20
qd_iv boolean,=20
qd_nt boolean,=20
qd_sb boolean,=20
qd_bl boolean,=20
qd_ov boolean,=20
CONSTRAINT idValueLog PRIMARY KEY (idValueLog)=20
)=20
WITHOUT OIDS;=20
ALTER TABLE ValueLog OWNER TO $admin_user;"=20
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, almv=
alue where ppoint.ppx =3D valuelog.ppx and almvalue.almvalue =3D valuelog=
..ivalue and valuelog.ppx =3D $db_ppx and to_char(valuelog.t_arr,'YYYYMMD=
D') >=3D '$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 sit=
e on the server Fedora Core 3, I had problems with the date filtering. Ru=
nning psql on the server I've noticed that there were more data in the se=
lect * from value log results, field t_arr something like MM-DD-YYYY-dsf=
sdfd (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
=09
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.=20
--0-1781307543-1141083974=:27486
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,
I have the following table running on postgres 8.04:
&n=
bsp; CREATE TABLE ValueLog
(
 =
; idValueLog int4 NOT NULL DEFAULT nextval ('public.idV=
alueLog_seq'::text),
PPx integer,
=
iValue integer DEFAULT -1,
 =
; fValue real DEFAULT -1,
&=
nbsp; t_tag timestamp without time zone,
&nbs=
p; t_arr timestamp without time zone,
=
cot integer,
ack boolean,
&n=
bsp; blk boolean,
qd=
_iv boolean,
qd_nt boolean,
=
qd_sb boolean,
 =
; qd_bl boolean,
qd_ov boolean,
&n=
bsp; CONSTRAINT
idValueLog PRIMARY KEY (idValueLog)
)
&=
nbsp; WITHOUT OIDS;
 =
; ALTER TABLE ValueLog OWNER TO $admin_user;"
I've cr=
eated the following SQL statement to select the records newer then a give=
n date:
select almvalue.almname , ppoint.ppdimstr, valuelog.ack, v=
aluelog.blk, to_char(valuelog.t_arr,'DD.MM.YYYY HH24:MI:SS') from ppoint,=
valuelog, almvalue where ppoint.ppx =3D valuelog.ppx and almvalue.almval=
ue =3D valuelog.ivalue and valuelog.ppx =3D $db_ppx and to_char(val=
uelog.t_arr,'YYYYMMDD') >=3D '$ts
$ts is a string, the date val=
ue 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 serve=
r 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 t=
hink that the local time settings on the server makes me the troubles.
>
What's the solution?
What's the best way to do filtering (sel=
ecting) data by time?
TIA, Jovan
Yahoo! Mail
Bring photos to life! com/evt=3D39174/*http://photomail.mail.yahoo.com">New PhotoMail make=
s sharing a breeze.=20
--0-1781307543-1141083974=:27486--