Problems with Filter in fields of Type TDataTime.

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
luapfr
Posts: 37
Joined: Thu 11 Apr 2013 13:11

Problems with Filter in fields of Type TDataTime.

Post by luapfr » Tue 26 Jul 2022 10:41

it seems that the Filter Property is very limited and doesn't support features for Filters in DataTime type.

the code below works with TClientDataset

TUniQuery.Filter := '(Day(aDATA) = 20) and (Month(aDATA) = 07) and (Year(aDATA) = 2022)';

or it could be something like

TUniQuery.Filter := '( Cast(aDATA As Date) = ''20.07.2022'' )';

but nothing works

How could I make a similar filter on a field of Type TDateTime ?

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Problems with Filter in fields of Type TDataTime.

Post by pavelpd » Wed 03 Aug 2022 05:34

Hi,
Thanks for your request!

Please note, that currently, UniDAC's "Filter" property does not support such filter expressions using SQL functions.

To use such expressions, you can use the "FilterSQL" property.
Example:
...
UniQuery.FilterSQL := '(Day(aDATA) = 20) and (Month(aDATA) = 07) and (Year(aDATA) = 2022)';
...

You can find more information about the "FilterSQL" property using the link to our documentation:
https://docs.devart.com/unidac/devart.d ... tersql.htm

We'll explore the possibility of using such filtering conditions in a regular "Filter" property.

luapfr
Posts: 37
Joined: Thu 11 Apr 2013 13:11

Re: Problems with Filter in fields of Type TDataTime.

Post by luapfr » Wed 03 Aug 2022 12:51

FilterSQL is a bad option as it reopens the Query

Filter is much better as it works locally without reopening the query
It would be interesting for you to put all the existing filter options in the TDataSet Filter to be compatible and be more powerful.

pavelpd
Devart Team
Posts: 109
Joined: Thu 06 Jan 2022 14:16

Re: Problems with Filter in fields of Type TDataTime.

Post by pavelpd » Wed 10 Aug 2022 12:26

Hi,
Thanks for your response!

We will take into account your recommendations in further consideration of the property "Filter".

Kindly note, that we cannot give an exact time frame for considering this issue at the moment.

Please feel free to contact us if you have any further questions about our products.

Post Reply