Can anyone tell a newbe why I get this error?
"Project raised exception class 'EDatabaseError' with message: no such column: max"
I have a table (called PAYMENTS), which gets updated with data from data aware controls on a form (called fmPayments). Table PAYMENTS has an auto incremented Key field named PmtIdx, plus other fields that hold user input data. fmPayments has a TSQLQuery and TDataSource on it. TSQLite3Connection and TSQLTransaction are on a data module called GLOBAL.
When the Save button on form Payments is clicked, I want some of the fields from the just added record (i.e. with highest Key value) in PAYMENTS to be copied to the corresponding fields (some with different names) in a another table called LEDGER. When I try to run the project, I get the error message at compile time.
I'm trying to use the MAX function in SQLite to select the most recent record in PAYMENTS. Evidently my syntax is wrong. Can anyone show me (with some example code) the best way to achieve my goal of wriing the most recent data from PAYMENTS into LEDGER?
I'm using Lazarus ver 1.2.6, FPC ver 2.6.4, SVN rev 46529,
i386-win32-win32/win64, sqlite-shell-win32-x86-3080704