Execute SQL problem ( Fetch First with sum and arguments )
It appears I have bumped up into a problem with Execute SQL.
This is what I'm trying to do:
nrows = Invoices::page;
SELECT Sum ( a.\"Amount_nodiscount_faratva\" )
FROM \"Invoice Data\" a
WHERE a.\"INVOICE ID MATCH FIELD\" = ?
FETCH FIRST ? ROWS ONLY
; "|" ; ¶ ;
Invoice ID; nrows
Everything works fine, except the query :(.
Firstly it appears that even if I have Fetch First the Sum ( ) doesn't care and does it for all of the records that meet Where condition.
Secondly I can't manage the have that second argument in the Fetch First, every time I put it there the result is ? (Even with a working query).
Please help or try to give some pointers on how I could do this otherwise.