EhLibSupport wrote:
Hello
I created simple App with fields size 8 and 20.
When I entered text into the DBGridEh column values, I didn't have any problem with the text being entered.
Attachment:
The attachment sshot-135.png is no longer available
I haven't explained very well, sorry!
The problem is when I "enter" those fields. If I first enter the field that has the size of 8, the data gets selected properly. But if I afterwards "enter" a filed that has a size of 20 only 8 characters will be selected and the rest would not be shown. ( I have attached 2 screenshots that show this)
Quote:
Looks like FPC in method TBufDatasetParser.ParseExpression doesn't support filters for TDate fields.
We tested next expression: DataSet.Filter := 'DateField3=''18.08.2020''';
Do you know how to write filter expressions for TDate fields?
We don't know how.
This is the expression that should be used:
Filtering is similar - note: apparently you need to surround the string value you are comparing against with double quotes. See below for details on the DTOS function; basically you need to format the date as YYYYMMDD:
// we have a field named MODIFIED here:
MyDBF.Filter:='DTOS(MODIFIED) > "20051231"';
// if you want to compare datetime, that can be done:
// everything later than 2 January 2006, 4:34PM
MyDBF.Filter:='DTOS(MODIFIED) > "20060102 163400"';
MyDBF.Filtered:=true;
Best Regards!