advDBFilterPanel and datetime

Hello,

I created simple MSSQL 13.0 DB application with advDBFilterPanel,AdvDBgrid and FireDAC components, works great except when filtering Datetime field I get conversion error.
I cought generated query with FDmonitor and it would work if only condition datetime value would have single quotes.

generated query : SELECT * FROM tabela1 WHERE polje6 < 1.01.2150  - firedac raise exception
modified by hand: SELECT * FROM tabela1 WHERE polje6 < '1.01.2150' returns records

Is there any workaround 
 

In order to accommodate different SQL variations to specify dates in the WHERE clause, we've added a property SQLDateSeparator, so, in the next update, you'll be able to set this to '  to handle this case.

Hi,

Can you describe it in more details ? As I also face the same problem. The date time field picker in ADVDBFilterPanel is in wrong format. If I just select a date from calender, it still error.

After select the date from date picker and click apply filter button, it will display error ! Why ? is it bug ?

TAdvDBFilterPanel generates a DataSet.Filter instruction. Different datasets can require different quotes around the data in the filter instruction. So, for example, if the dataset you use requires to use a single quote, you'll need to set SQLDateSeparator to ' , if this is ADO and thus requires # as a quote, you'll need to set SQLDateSeparator to #

I just click the build in date picker and select the date, once selected it display this error message...

not involve the sql statement or change sql statement in this code.

Yes, but internally a filter needs to be built and it needs to use quotes that match the requirement of your dataset you use.

I add ' in SQLDateSeparator. then display this error.


image

My mistake, it is the SQLDateQuote you need to set

Hi,

Where ? I cannot find this properties.

image

You need the latest version of TMS VCL UI Pack.

It is not work. Even I choose the correct date from date picker. The query does not change ..

Why ?

Can you please provide a sample source project with which we can reproduce your problem.
We do not know what database, what dataset component, what Delphi version etc... you use.
We cannot see an issue here, so we need details.