Page 1 of 1

Problems with Filter in fields of Type TDataTime.

Posted: Tue 26 Jul 2022 10:41
by luapfr
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 ?

Re: Problems with Filter in fields of Type TDataTime.

Posted: Wed 03 Aug 2022 05:34
by pavelpd
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.

Re: Problems with Filter in fields of Type TDataTime.

Posted: Wed 03 Aug 2022 12:51
by luapfr
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.

Re: Problems with Filter in fields of Type TDataTime.

Posted: Wed 10 Aug 2022 12:26
by pavelpd
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.