Carmen,
You should add an ORDER BY to the select so you can get the records in the proper order. Then you can use a Group Band and Report Variables in the report designer to create totals.
>I have a table which contains invoiceno, invdate,custno called inv
>, and a table called dotrn which contains invoiceno,dnno,paticulars,amount,driver,notrip and a table called
>driver table which contains driver code, driver name, trip1,trip2,trip3,rate1,rate2,rate3
>trip1...trip3 contains no of trip for example trip1 = 1, trip2 = 5,trip3=10 , and rate1..rate3 means % of commission rate.
>
>I want to produce the report that to print out all the invoice detail and calculate the no of trip and get the commission rate for each driver.
>
>so in the report
>
>my sql statement :
>
>select invoiceno,invdate,dnno,particular,amount,notrip,driver,trip1,trip2,trip3,rate1,rate2,rate3 from dotrn,invoice,driver where invoiceno=dotrn.invoiceno and driver.driverno=dotrn.driverno into cursor aa
>
>it print out all the details for each driver but the thing is i cant sum up all the notrip and compare in between trip and get the commission rate .....
>
>anyone can help me on this.. thank you