Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
//Here is the MySql Statment
SELECT sum(R.convention_amt + R.banquet_amt) AS reg_due, sum(P.payment) AS ttl_paid, reg_due - ttl_paid AS owes
FROM convention_registrations AS R, convention_payments AS P
WHERE R.account_nbr = acct_nbr AND P.account_nbr = acct_nbr
//The Error referes to "reg_due - ttl_paid AS owes"
//Here is the general Table layouts
Table convention_registrations
account_nbr, convention_amt, banquet_amt
Table convention_payments
account_nbr, payment
SELECT sum(COALESCE(R.convention_amt,0) + COALESCE(R.banquet_amt,0)) AS reg_due, sum(COALESCE(P.payment,0)) AS ttl_paid, sum(COALESCE(R.convention_amt,0) + COALESCE(R.banquet_amt,0)) - sum(COALESCE(P.payment,0)) AS owes
FROM convention_registrations AS R, convention_payments AS P
WHERE R.account_nbr = acct_nbr AND P.account_nbr = acct_nbr
SELECT sum(COALESCE(R.convention_amt,0) + COALESCE(R.banquet_amt,0)) AS reg_due, sum(COALESCE(P.payment,0)) AS ttl_paid, sum(COALESCE(R.convention_amt,0) + COALESCE(R.banquet_amt,0)) - sum(COALESCE(P.payment,0)) AS owes
FROM convention_registrations AS R left outer join convention_payments AS P on R.account_nbr = acct_nbr AND P.account_nbr = acct_nbr
If you are experiencing a similar issue, please ask a related question
Join the community of 500,000 technology professionals and ask your questions.