N
novice_techy
I have the following sql code in the data environment in a data report
in vb6 sp4 with ms access 2002.
SELECT gas_bill.spaceno, max(gas_bill.name_gas) AS name_gas,
Max(gas_bill.total_due) AS total_due,
Sum(IIf(receipts.check_amt=NULL,0,receipts.check_amt)) AS check_amt,
Sum(IIf(receipts.cash_amt=NULL,0,receipts.cash_amt)) AS cash_amt,
(Max(gas_bill.total_due)-Sum(IIf(receipts.check_amt=NULL,0,receipts.check_amt)))
AS diffl,
(Max(gas_bill.total_due)-Sum(IIf(receipts.cash_amt=NULL,0,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:
http://www.geocities.com/[email protected]/report.JPG
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??
in vb6 sp4 with ms access 2002.
SELECT gas_bill.spaceno, max(gas_bill.name_gas) AS name_gas,
Max(gas_bill.total_due) AS total_due,
Sum(IIf(receipts.check_amt=NULL,0,receipts.check_amt)) AS check_amt,
Sum(IIf(receipts.cash_amt=NULL,0,receipts.cash_amt)) AS cash_amt,
(Max(gas_bill.total_due)-Sum(IIf(receipts.check_amt=NULL,0,receipts.check_amt)))
AS diffl,
(Max(gas_bill.total_due)-Sum(IIf(receipts.cash_amt=NULL,0,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:
http://www.geocities.com/[email protected]/report.JPG
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??