I am trying to get the max value of a column in Interbase 7 using this code:
int maxValue = (int)adapterApm.GetScalar(MaterialesFields.Id,null,AggregateFunction.Max,null);
I have made that with a stored proc before, but I want to learn to use it in LLBL, however I have been trying using help, and I get this:
An exception was caught during the execution of a retrieval query: Dynamic SQL Error
SQL error code = -104
On the error Detail, the QUERY EXECUTED IS THIS:
"\r\n\tQuery: SELECT FIRST 1 MAX(\"MATERIALES\".\"ID\") AS \"Id\" FROM \"MATERIALES\"\r\n"
After runing that on Interbase
SELECT FIRST 1 MAX (MATERIALES.ID) AS Id FROM MATERIALES
I am getting errors, I use to make it as this:
SELECT MAX (MATERIALES.ID) AS Id
FROM MATERIALES
I would like to know if I am calling it the wrong way or what may be my error?
I did run the same code for SQL server and worked ok, so I think it may be my driver or something.
Regards