JacobTechy
Programmer
I have the following sql code in the data environment in a data report in vb6 sp4 with ms access 2002.
sample of how report looks like:
report sample
My problem is that I cannot get the the null check amts or cash amts to subtract unless they are $0.00. How can I add zeros to these fields if they are null to allow the calculation to take place for the non payed customer. I know that, in my receipts table I only have 3 records which is why the $0.00 for the rest of the records do not show up, but records are added as the customer pays either by cash or check. Can I add sql code??
Code:
SELECT gas_bill.spaceno, max(gas_bill.name_gas) as name_gas,
Max(gas_bill.total_due) as total_due,
Sum(receipts.check_amt) as check_amt,
Sum(receipts.cash_amt) as cash_amt,
(Max(gas_bill.total_due) -Sum(receipts.check_amt)) as difflcheck,
(Max(gas_bill.total_due) -Sum(receipts.cash_amt)) as difflcash
FROM receipts RIGHT JOIN gas_bill ON receipts.spaceno=gas_bill.spaceno group by gas_bill.spaceno
sample of how report looks like:
report sample
My problem is that I cannot get the the null check amts or cash amts to subtract unless they are $0.00. How can I add zeros to these fields if they are null to allow the calculation to take place for the non payed customer. I know that, in my receipts table I only have 3 records which is why the $0.00 for the rest of the records do not show up, but records are added as the customer pays either by cash or check. Can I add sql code??