MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 638

Developing coldfusion mx applications
Table of Contents

Advertisement

<td>#FirstName# #LastName#</td>
<td>#dateFormat(StartDate, "mm/dd/yyyy")#</td>
<td>#numberFormat(Salary, "$999,999")#</td>
<td>#Contract#</td>
</tr>
</cfoutput>
</table>
</body>
</html>
Save the page as Salary_details.cfm in myapps under the web root directory.
2
Reviewing the code
The following table describes the code and its function:
Code
<cfquery name="GetSalaryDetails"
datasource="CompanyInfo">
SELECT
Departmt.Dept_Name,
Employee.FirstName,
Employee.LastName,
Employee.StartDate,
Employee.Salary,
Employee.Contract
FROM Departmt, Employee
WHERE
Departmt.Dept_Name =
'#URL.Item#'
AND Departmt.Dept_ID =
Employee.Dept_ID
ORDER BY Employee.LastName,
Employee.Firstname
</cfquery>
<table border cellspacing=0 cellpadding=5>
<tr>
<th>Employee Name</td>
<th>StartDate</td>
<th>Salary</td>
<th>Contract?</td>
</tr>
<cfoutput query="GetSalaryDetails" >
<tr>
<td>#FirstName# #LastName#</td>
<td>#dateFormat(StartDate,
"mm/dd/yyyy")#</td>
<td>#numberFormat(Salary, "$999,999")#</td>
<td>#Contract#</td>
</tr>
</cfoutput>
</table>
638
Chapter 28: Charting and Graphing Data
Description
Get the salary data for the department
whose name was passed in the URL
parameter string. Sort the data by the
employee's last and first names.
Display the data retrieved by the query
as a table. Format the start date into
standard month/date/year format, and
format the salary with a leading dollar
sign comma separator, and no decimal
places.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents