dimanche 27 septembre 2015

How in Delphi can I force an SQLite aggregate field to be a numeric field?

We are converting a program written for MySQL to use SQLite. Some of the code adapts automatically to the type of fields we get back from the database. SQLite has the "interesting" property of converting aggregates to ftWideString (presumably to handle possible overflow). I want these fields to be integer or float fields. I tried this:

SELECT cast(sum(units) as int) FROM dr02

but the type is still ftWideString.

How can I make it return an ftInteger or ftLargeInt, or ftFloat, as required?

TIA Mark

Aucun commentaire:

Enregistrer un commentaire