Is not a valid date time format on filter

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
royyu
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 17.10.2014, 15:56

Is not a valid date time format on filter

Postby royyu » 13.06.2016, 07:51

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!!!

marsupilami
Gold Boarder
Gold Boarder
Posts: 580
Joined: 17.01.2011, 14:17

Re: Is not a valid date time format on filter

Postby marsupilami » 13.06.2016, 10:59

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

royyu
Fresh Boarder
Fresh Boarder
Posts: 7
Joined: 17.10.2014, 15:56

Re: Is not a valid date time format on filter

Postby royyu » 14.06.2016, 08:58

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,
You do not have the required permissions to view the files attached to this post.

miab3
Zeos Test Team
Zeos Test Team
Posts: 913
Joined: 11.05.2012, 12:32
Location: Poland

Re: Is not a valid date time format on filter

Postby miab3 » 14.06.2016, 12:28

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


Return to “ZeosLib 7.0 Stable Forum”

Who is online

Users browsing this forum: No registered users and 1 guest