Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

How can I filter with dates in my adoquery dataset?

I tried this and nothing

  QServerXML1.Filter   := 'SV1_DATAHORA=#16/03/2012#';
  QServerXML1.Filtered := tRUE
Avatar of Geert G
Geert G
Flag of Belgium image

have you tried like solution in this Q ?
https://www.experts-exchange.com/questions/21441584/Using-Filter-option-in-TADOQuery.html

uses DateUtils;

QServerXML1.filter := 'OrderDate=' + FloatToStr(EncodeDate(2012,03,16));
SOLUTION
Avatar of Thommy
Thommy
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
offtopic> Thommy
are you trying to beat my score overal or just this year ?

nothing really new in your last response
Sorry Geert, don't wanna chase your score!!!

I should have been reading your EE link before posting my answer.
It clearly says what I meant...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>hidrau
what is the exception msg ?

>>Thommy
I was only joking, no need to apologize

i'd check further along Thommy's comments for Date format

> check your environment settings
> have you set a default in your delphi environment ?
> what type of database is it ?
> what date type and date type input does it expect for the filter
Avatar of hidrau

ASKER

My Database is MS SQL 2005

The field is datetime.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hidrau

ASKER

Delphi gave me the following message: incorrect arguments
Avatar of hidrau

ASKER

thanks