I have two tables.
<b>TableA</b>
CustID FName LName Credit
a12345 Joe Smith 20.00
a14568 Jane Doe Null
a56898 John Doe Null
<b>TableB</b>
OrderID CustID OrderTotal PaidTotal
15589 a12345 7.00 null
15658 a14568 5.00 17.00
15688 a56898 4.00 4.00
I want to be able to get the Credit from TableA(if there is one) and add it to whatever Paidtotal - OrderTotal.
Ive tried it a couple of ways:
This way it errors out.
Select sum((o.PaidTotal - rdertotal) + c.credit) as credit
This I get a null value.
Select sum((o.PaidTotal - rdertotal) + c.credit as Credit
Thanks in advance.
AJ
If at first you do not succeed, cheat!
<b>TableA</b>
CustID FName LName Credit
a12345 Joe Smith 20.00
a14568 Jane Doe Null
a56898 John Doe Null
<b>TableB</b>
OrderID CustID OrderTotal PaidTotal
15589 a12345 7.00 null
15658 a14568 5.00 17.00
15688 a56898 4.00 4.00
I want to be able to get the Credit from TableA(if there is one) and add it to whatever Paidtotal - OrderTotal.
Ive tried it a couple of ways:
This way it errors out.
Select sum((o.PaidTotal - rdertotal) + c.credit) as credit
This I get a null value.
Select sum((o.PaidTotal - rdertotal) + c.credit as Credit
Thanks in advance.
AJ
If at first you do not succeed, cheat!