Question
Subract sums of two queries from each other to get subtotal
Once again, I'm in over my head - help help!
I have been struggling with this off and on over the last couple weeks and I'm not sure to look for a solution.
Here's what I'm trying to do:
Schools send checks covering workshop fees, multiple registrations per workshop and per school. Subtotal the amounts of the checks per school. Add the amounts of the paid registration fees per school, and subtract the subtotal from the subtotal of checks. Display the result.
I feel like I'm going in the right direction, but I'm obviously missing something essential because I get this error:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
The error occurred in C:\Inetpub\wwwroot\crtis\admin\schoolFin\allSchoolFin_credit.cfm: line 65
63 : </cfquery>
64 :
65 : <cfquery name="getSubTotal" dbtype="query">
66 : SELECT getSTChecks.s_SchoolName AS s_SchoolName, getSTWSCost.s_SchoolName, SUM(getSTChecks.STChecks - getSTWSCost.STWSCost) AS SubTotal
67 : FROM getSTChecks, getSTWSCost
I would be grateful for either a nudge toward some reading (CFWACK?) or if someone wants to take a look at my code and make a suggestion, that would be most welcome.
I have been struggling with this off and on over the last couple weeks and I'm not sure to look for a solution.
Here's what I'm trying to do:
Schools send checks covering workshop fees, multiple registrations per workshop and per school. Subtotal the amounts of the checks per school. Add the amounts of the paid registration fees per school, and subtract the subtotal from the subtotal of checks. Display the result.
I feel like I'm going in the right direction, but I'm obviously missing something essential because I get this error:
The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.
Null Pointers are another name for undefined values.
The error occurred in C:\Inetpub\wwwroot\crtis\admin\schoolFin\allSchoolFin_credit.cfm: line 65
63 : </cfquery>
64 :
65 : <cfquery name="getSubTotal" dbtype="query">
66 : SELECT getSTChecks.s_SchoolName AS s_SchoolName, getSTWSCost.s_SchoolName, SUM(getSTChecks.STChecks - getSTWSCost.STWSCost) AS SubTotal
67 : FROM getSTChecks, getSTWSCost
I would be grateful for either a nudge toward some reading (CFWACK?) or if someone wants to take a look at my code and make a suggestion, that would be most welcome.
