R
Rachel
hi,
I have the following stored procedure and i would like to know how I
would update a table with the results:
Create PROCEDURE Proc_UpdateBalance
AS
RETURN
select
i.Case_ID,
count(*) as InvoiceCount,
sum(i.Amount) as invoiceAmount,
count(distinct i.Case_ID) as CaseCount
from tbl_Invoice i
inner join
tbl_Case c on i.Case_ID = c.Case_ID
group by i.Case_ID
This returns:
Case_ID InvoiceCount InvoiceAmount CaseCount
121212 2 £9000.00 1
121213 1 £1000
1
121214 1 £8000
1
I want to insert InvoiceAmount into a table called tbl_Case (field
named Balance). How do I do this?
Many Thanks
Rachel
I have the following stored procedure and i would like to know how I
would update a table with the results:
Create PROCEDURE Proc_UpdateBalance
AS
RETURN
select
i.Case_ID,
count(*) as InvoiceCount,
sum(i.Amount) as invoiceAmount,
count(distinct i.Case_ID) as CaseCount
from tbl_Invoice i
inner join
tbl_Case c on i.Case_ID = c.Case_ID
group by i.Case_ID
This returns:
Case_ID InvoiceCount InvoiceAmount CaseCount
121212 2 £9000.00 1
121213 1 £1000
1
121214 1 £8000
1
I want to insert InvoiceAmount into a table called tbl_Case (field
named Balance). How do I do this?
Many Thanks
Rachel