CFOUTPUT QUERY="kilns" GROUP="ruhID"> <cfset intotal = 0> <cfif rudTotal GT 0> <cfset intotal = intotal + rudTotal> <cfset Total_Value_In = Total_Value_In + intotal> </cfif>
<cfquery name="KilnsById" dbtype="query"> SELECT * FROM Kilns ORDER BY ruhId ASC </cfquery> <cfset TotalTotal = 0 /> <cfoutput query="KilnsById" group="ruhId"> <cfset InTotal = 0 /> <cfoutput> <cfset InTotal += rudTotal /> </cfoutput> <cfset TotalTotal += InTotal /> </cfloop>
<cfquery name="KilnsById" dbtype="query"> SELECT * FROM Kilns ORDER BY ruhId ASC </cfquery> <cfset TotalTotal = 0 /> <cfset InTotal = [] /> <cfoutput query="KilnsById" group="ruhId"> <cfset InTotal[ruhId] = 0 /> <cfoutput> <cfset InTotal[ruhId] += rudTotal /> </cfoutput> <cfset TotalTotal += InTotal[ruhId] /> </cfloop>
<cfquery name="KilnsById" dbtype="query"> SELECT * FROM Kilns ORDER BY ruhId ASC </cfquery> <cfset TotalTotal = 0 /> <cfset InTotal = [] /> <cfoutput query="KilnsById" group="ruhId"> <cfset InTotal[ruhId] = 0 /> <cfoutput> <cfset InTotal[ruhId] += rudTotal /> </cfoutput> <cfset TotalTotal += InTotal[ruhId] /> </cfoutput>
<cfset InTotal = [] />
<cfset InTotal = {} />
Not a problem at all. It didn't work, but I'm taking a break and going to look at the SQL Reporting side of it for a bit. It has me confused and I need a break!
Thanks for your time!
Paeter most of my issue wasn't coding at all. My database contains both consumed and produced product. I only wanted to add consumed and ignore the produced.
Armed with that information I kicked it's ass and now have it adding what I want.
Appreciate you taking the time to whisper sweet nothings in my ear!
What do you suggest the best way to put this data in to a database so I can use it to compare against another database?
I will need to check for type of wood and thickness and then pull that value to multiply by.
CREATE TABLE wood_costs ( species VARCHAR(30) NOT NULL , thickness TINYINT NOT NULL , cost SMALLINT DEFAULT NULL ); INSERT INTO wood_costs ('Red Oak',3,85); INSERT INTO wood_costs ('Red Oak',4,85); ... INSERT INTO wood_costs ('Hard Maple',7,135); ... INSERT INTO wood_costs ('Other Hardwood',16,285);