Confused about Filter property in TXdataWebdataset

I have just started using Filter. And I am not sure about the syntax. I have

  xds_.Filter := 'Cat_Type eq "S"';
  xds_.Filtered := True;

xds is TXdataWebDataSet
Cat_Type is a field

I get

ObjectFHelpContext: 0FJSError: Error: Badly terminated expression. Found token at position 12 : eq
at Object.Create$1 (http://localhost:8000/ops/ops_1_0_1053.js:3487:23)
at c.$create (http://localhost:8000/ops/ops_1_0_1053.js:359:19)
at Object.ParserError (http://localhost:8000/ops/ops_1_0_1053.js:77302:30)
at Object.SetExpression (http://localhost:8000/ops/ops_1_0_1053.js:77316:62)
at Object.CreateFilterExpression (http://localhost:8000/ops/ops_1_0_1053.js:79360:14)
at Object.DoFilterRecord (http://localhost:8000/ops/ops_1_0_1053.js:79378:76)
at Object.GetRecord (http://localhost:8000/ops/ops_1_0_1053.js:79459:35)
at Object.GetNextRecord (http://localhost:8000/ops/ops_1_0_1053.js:73336:21)
at Object.GetNextRecords (http://localhost:8000/ops/ops_1_0_1053.js:73329:62)
at Object.First (http://localhost:8000/ops/ops_1_0_1053.js:74032:43)FMessage: "Badly terminated expression. Found token at position 12 : eq"FStack: "Error: Badly terminated expression. Found token at position 12 : eq\n at Object.Create$1 (http://localhost:8000/ops/ops_1_0_1053.js:3487:23)\n at c.$create (http://localhost:8000/ops/ops_1_0_1053.js:359:19)\n at Object.ParserError (http://localhost:8000/ops/ops_1_0_1053.js:77302:30)\n at Object.SetExpression (http://localhost:8000/ops/ops_1_0_1053.js:77316:62)\n at Object.CreateFilterExpression (http://localhost:8000/ops/ops_1_0_1053.js:79360:14)\n at Object.DoFilterRecord (http://localhost:8000/ops/ops_1_0_1053.js:79378:76)\n at Object.GetRecord (http://localhost:8000/ops/ops_1_0_1053.js:79459:35)\n at Object.GetNextRecord (http://localhost:8000/ops/ops_1_0_1053.js:73336:21)\n at Object.GetNextRecords (http://localhost:8000/ops/ops_1_0_1053.js:73329:62)\n at Object.First (http://localhost:8000/ops/ops_1_0_1053.js:74032:43)"[[Prototype]]: Object

It looks like this works

  xds_.Filter := 'Num_Pax = 1';

Where Num_Pax is a numeric field.

But this fails on a string field

  xds_.Filter := 'Trip_Name = "Trip2"';

It says

Unknown identifier Trip2.

It looks like double-quote is not accepted for string so this works

  xds_.Filter := 'Trip_Name = ''Trip2''';

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.