jayjabour
04-13-2006, 12:49 PM
I need help writing a script that adds up an amount feild of several rows in a table. Here is the situation. I have a 9i db and there is a table called ex_sheet_vw that stores information about employees expense reports. The table looks like this:
sheet_id emplid line amount
000001 123 1 30.00
000001 123 2 20.00
000002 124 1 10.00
000002 124 2 5.00
000002 124 3 2.00
What I need is a script that shows the emplid sheet_id and total amount for each expense report. Some reports have one line some have 2 some 3 it all depends and the amount of lines are different. But I would need to know that sheet_id 000001 was for $50.00. and 000002 was for $17.00. Any advice would be greatly appreciated.
sheet_id emplid line amount
000001 123 1 30.00
000001 123 2 20.00
000002 124 1 10.00
000002 124 2 5.00
000002 124 3 2.00
What I need is a script that shows the emplid sheet_id and total amount for each expense report. Some reports have one line some have 2 some 3 it all depends and the amount of lines are different. But I would need to know that sheet_id 000001 was for $50.00. and 000002 was for $17.00. Any advice would be greatly appreciated.