>Hi all!
>
>Why functions SUM(amount) do not work in this request ?
>DataBase - Oracle7
>
>.....
>lnConnHandle = sqlconnect('connection', 'user','password')
>*
>IF lnConnHandle <= 0
> = MESSAGEBOX('Error',16,'Error')
>ELSE
> = MESSAGEBOX('Connection enabled', 48, 'Success')
> = SQLSETPROP(lnConnHandle, 'PacketSize', 16000)
>*
> lcSelect = "SELECT SUM(amount), doc_sys, branch_sys,pos_type, debit_id,";
> +"credit_id,cash_simbol, amount, currency, equivalent,";
> +"remarks, value_date, note, model, doc_type ";
> +"from odt_acps_archive ";
> +"where value_date = '19.11.99'"
>*
> = SQLEXEC(lnConnHandle, lcSelect, 'MyCursor')
> = SQLDISCONNECT(lnConnHandle)
>....
>
>However either as the whole request.
>Without functions SUM or other functions - all works!
>
>What can I do ?
>Thank's.
>
>Yuri.
You need to group by for SUM() to work. You are getting 1 record back, the total? also take out that amount column in your field list if you ar summing on it.
__Stephen