Strange problem with Filtering.
I have created an integer variable, Today, in the format YYYYMMDD. I then read a variable from an ADOTable, ExpYearMonDay, in the same format. I then have the following code:
ExpYearMonDay := Form_Main.ADOTable1.FieldByName('ExpYearMonDay').AsInteger;
Form_Main.ADOTable1.Filter := 'ExpYearMonDay >= Today';
Form_Main.ADOTable1.Filtered := true;
This fails. After The Filtered line the remainder of the code in the procedure is skipped. If I replace the Today interger value with 20101217, today’s date, the code works.
Both variables are declared as integers.
What is my problem and what is the solution
I an running Delphi 7 on a Windows 7 machine.
I have created an integer variable, Today, in the format YYYYMMDD. I then read a variable from an ADOTable, ExpYearMonDay, in the same format. I then have the following code:
ExpYearMonDay := Form_Main.ADOTable1.FieldByName('ExpYearMonDay').AsInteger;
Form_Main.ADOTable1.Filter := 'ExpYearMonDay >= Today';
Form_Main.ADOTable1.Filtered := true;
This fails. After The Filtered line the remainder of the code in the procedure is skipped. If I replace the Today interger value with 20101217, today’s date, the code works.
Both variables are declared as integers.
What is my problem and what is the solution
I an running Delphi 7 on a Windows 7 machine.