To enhance the query results:
To sort the trip names in alphabetical order in the triplisting.cfm page, modify the SQL
1
SELECT statement within the
SELECT tripName FROM trips ORDER BY tripName
To display the departure, return date, and price for each trip, modify the same SQL statement.
2
Modify the SQL SELECT statement, as follows:
a
SELECT tripName, departureDate, returnDate, price
FROM trips
ORDER BY tripName
Change the output block (the code immediately preceding the
b
to include all three selected fields, as follows:
#tripName#
#tripName# departs: #departureDate# returns: #returnDate# price:
#price#<BR>
Create the Budget Trip List report by doing the following:
3
Modify the SQL SELECT statement, as follows:
a
SELECT tripName, departureDate, returnDate, price
FROM trips
WHERE price <= 1500
ORDER BY tripName
Change the heading tag from
b
View the triplisting.cfm in a browser and verify that all the new requirements were met. The
4
revised TripListing.cfm page looks like this:
Note that the dates and prices in the preceding listing are not formatted. In
a Main Application
tags as follows:
cfquery
<h1>Trip List</h1> to <h1>Budget Trip List</h1>.
Page, you will enhance the look of this page.
tag) from just
</cfoutput>
Lesson 3: Creating
Using a web page to list trips
65
Need help?
Do you have a question about the COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?