BananaQuaaludes
Programmer
I am using the following cross-tab query to form a recordset:
strSQL = "TRANSFORM Max(tblCrossTab.Hours) AS MaxOfHours SELECT tblCrossTab.EmpName, Sum(tblCrossTab.Hours) AS [Total Of Hours] FROM tblCrossTab GROUP BY tblCrossTab.EmpName PIVOT tblCrossTab.Month;"
How do I loop through the contents of that query to populate an HTML table? The following code produces the "Item cannot be found in the collection corresponding to the requested name or ordinal" error on the "MaxOfHours" line:
<% do until RS.EOF %>
<tr>
<td><%=RS("EmpName"%></td>
<td><%=RS("MaxOfHours"%></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<% RS.MoveNext
loop
I've tried referencing the other fields in the query, but the only field I can get out of the recordset is the EmpName. Do I need to change the query, or is the data there but I'm not referencing it correctly?
Thanks!
strSQL = "TRANSFORM Max(tblCrossTab.Hours) AS MaxOfHours SELECT tblCrossTab.EmpName, Sum(tblCrossTab.Hours) AS [Total Of Hours] FROM tblCrossTab GROUP BY tblCrossTab.EmpName PIVOT tblCrossTab.Month;"
How do I loop through the contents of that query to populate an HTML table? The following code produces the "Item cannot be found in the collection corresponding to the requested name or ordinal" error on the "MaxOfHours" line:
<% do until RS.EOF %>
<tr>
<td><%=RS("EmpName"%></td>
<td><%=RS("MaxOfHours"%></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<% RS.MoveNext
loop
I've tried referencing the other fields in the query, but the only field I can get out of the recordset is the EmpName. Do I need to change the query, or is the data there but I'm not referencing it correctly?
Thanks!