 					</cfloop>
 					<th>#grandTotal#</th>
 				</tr>
+
 			</table>
 		</cfoutput>
 	</cfif>

	<cfif StructKeyExists(variables,"QItemAnalysis")>
		<cfoutput>
			<cfset DayRange = reportDateTo - reportDateFrom + 1>
			<table class="tableList" border="1">
				<tr>
					<th colspan="28">From: #DateFormat(reportDateFrom,"ddd dd-mmm-yy")# To: #DateFormat(reportDateTo,"ddd dd-mmm-yy")# #DayRange# Days</th>
				</tr>
				<tr>
					<th>Category</th>
					<th>Product</th>
					<th>Size</th>

	<cfquery name="QItemAnalysis" datasource="#parm.datasource#">
		SELECT prodID,prodCatID,prodEposCatID,prodTitle, siUnitSize, eiClass,eiType,eiNet,eiVAT, 
			ehID, ehTimeStamp, DATE(ehTimeStamp) AS yymmdd, HOUR(ehTimeStamp) AS hh, COUNT(*) AS recCount,
            (SELECT pcatTitle FROM tblProductCats WHERE pcatID = prodCatID) AS catTitle,
            (SELECT pgTitle FROM tblProductGroups INNER JOIN tblProductCats on pcatGroup=pgID WHERE pcatID = prodCatID) AS groupTitle
		FROM tblEPOS_Items
		INNER JOIN tblEPOS_Header ON ehID = eiParent
		INNER JOIN tblProducts ON prodID = eiProdID
