Page 1 of 1

Is not a valid date time format on filter

Posted: 13.06.2016, 07:51
by royyu
Hello!

Any solution of the following problems?
viewtopic.php?t=2528

I am using Delphi 2009 with postgresql DB.
I have got an error 'is not a valid date and time' when I try to filter a string like 'aaaa-bbbb-cccc'
And the field is in varchar type in DB but not date type.

Thanks!!!

Re: Is not a valid date time format on filter

Posted: 13.06.2016, 10:59
by marsupilami
Hello royyu,

could you please provide a small snippet of code how you try to do the filtering? It would be good if you also could provide a small table declaration and some sample data. This enables us to generate a small test case.
With best regards,

Jan

Re: Is not a valid date time format on filter

Posted: 14.06.2016, 08:58
by royyu
Hello Jan,

The table declaration is as below:
CREATE TABLE public.mf_goods (
goods_id SERIAL,
goods_code VARCHAR(40) DEFAULT ''::character varying,
goods VARCHAR(50) DEFAULT ''::character varying,
CONSTRAINT mf_goods_pkey PRIMARY KEY(goods_id)
) WITHOUT OIDS;

I am using a dataset ZQuery1 which sql is:
select * from mf_goods;

A button click event:
ZQuery1.Open;
ZQuery1.Filter := 'goods_code = ''UPD75104GF-J58-3BE''';
ZQuery1.Filtered := true;

and the error occur.

I am using WIN XP, and the Short Date Format in locale setting is 'YYYY-M-D'

Please see the attached files:
error.jpg
locale.jpg
goods.xls (sample data)

Thanks and Best Regards,

Re: Is not a valid date time format on filter

Posted: 14.06.2016, 12:28
by miab3
For me

ZEOS 7.2 svn 3909(and 7.3 svn 3905),
PostgreSQL 9.3,
Delphi XE2-32(Windows 7-32).

It:

Code: Select all

ZQuery4.Open;
ZQuery4.Filter := 'N_PELNA = ''UPD75104GF-J58-3BE''';
ZQuery4.Filtered:=True;
works without error.

Which ZEOS you use? (because 7.0 is very old and not corrected for years)

Michal