I have a SQL statement in a TFDQuery tied to an SQLite3 database. If I perform the following query it works fine if there rows that meet the WHERE clause. In this case MyMield is a float and when I pre-build the table fields using the field editor it shows up correctly as a TFloatField. However, if there are no matching rows (empty result), the MyMaxField is return as a TWideStringField. This does not match the type of field object I created at design them and returns and error (even at design time).
SELECT max(MyField) AS MyMaxfield FROM MyTable WHERE MyOtherFfield=10
I also tried using casting the max() to a REAL and it still fails.
Delphi 10.2