It does not seems that my code is outputing correctly . Whn there are 2 courses it only output the first one
<cfloop query="getPairs">
<cfquery name="getStepsCompleted"
datasource="cfelsunrise" dbtype="ODBC">
select CourseID, CompletionDate
from employeetraining
where EmployeeID = #getPairs.GTLID#
<cfif getPairs.CourseID eq 1635>
and CourseID in (1600, 1645,
1646)
</cfif>
<cfif getPairs.CourseID eq 1633>
and CourseID in (1600, 1655,
1656)
</cfif>
<cfif getPairs.CourseID eq 1634>
and CourseID in (1600, 1647,
1648)
</cfif>
<cfif getPairs.CourseID eq 1636>
and CourseID in (1600, 1649,
1650)
</cfif>
<cfif getPairs.CourseID eq 1632>
and CourseID in (1600, 1651,
1652)
</cfif>
<cfif getPairs.CourseID eq 1637>
and CourseID in (1600, 1653,
1654)
</cfif>
order by CourseID asc
</cfquery>
<cfscript>
arrStepsCompleted = ArrayNew(1);
arrStepsCompleted[1] = 0;
arrStepsCompleted[2] = 0;
arrStepsCompleted[3] = 0;
for(i=1; i lte getStepsCompleted.recordcount;
i=i+1) {
if (getStepsCompleted.CourseID[i] eq
1600) {
arrStepsCompleted[1] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1647) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1648) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1645) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1646) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1649) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1650) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1651) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1652) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1653) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1654) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1655) {
arrStepsCompleted[2] =
getStepsCompleted.CompletionDate[i];
}
else if (getStepsCompleted.CourseID[i]
eq 1656) {
arrStepsCompleted[3] =
getStepsCompleted.CompletionDate[i];
}
}
</cfscript>
<cfif isDate(arrStepsCompleted[1])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfswitch
expression="#getPairs.CourseID#">
<cfif getPairs.CourseID eq 1635>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
<cfif getPairs.CourseID eq 1634>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
<cfif getPairs.CourseID eq 1636>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
<cfif getPairs.CourseID eq 1632>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
<cfif getPairs.CourseID eq 1637>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
<cfif getPairs.CourseID eq 1633>
<cfif isDate(arrStepsCompleted[2])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfif isDate(arrStepsCompleted[3])>
<td width="25%" valign="top"
align="right" bgcolor="##009900"> </td>
<cfelse>
<td width="25%" valign="top"
align="right" bgcolor="##FF0000"> </td>
</cfif>
<cfelse>
<td> </td>
<td> </td>
</cfif>
</cfloop>
> erik tom wrote:
> > I am trying to output the table where I want to list people and
> their coourse completion . and it working . The problem that I am
> having It outputs the same Emp Id twice or more becaused each employee
> can signed up for multiple courses. How can i do that so each employee
> get to show up once and get the completion on the same row
>
> Look at the group attribute of cfoutput.
>
>
> I didn't actually look at your code because it has no readable
> comments
> and there is no way this is the shortest representation of your
> problem.
> You may want to check http://www.catb.org/~esr/faqs/smart-questions.
> html
> in order to get better answers in the future.
>
> Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307101
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

