The School for Champions is an educational website that shows you how to achieve your dreams.



Other ColdFusion topics:

Basics

Overview of ColdFusion

ColdFusion Features

Development methods

Setting up ColdFusion

ColdFusion Development Steps

Specific applications

Using Session Variables

Combining the Form and Action Pages

Using Drop-Down Lists

Converting ColdFusion to PDF

Dealing with Dates and Times

Sending a Flash Animation with ColdFusion Email

Changing Data to Telephone Format

Populating a New Database Table from an Old Table

Populating a Matrix Table

Sorting a Table Listing in ColdFusion

Also see:

Weekly Feedback Blog

ColdFusion Survey Results

Flash Development

Website Development

eLearning


SfC Home > ColdFusion >

Reader questions and feedback on ColdFusion Development. Also refer to markup language, CFML, Macromedia, Dreamweaver, code, web site, Ron Kurtus, School for Champions. Copyright © Restrictions

Answers to Readers' Questions on ColdFusion Development:

Sorting Table

The following 1 comments and questions have been sent in. They are listed according to date.

List of first 10 items

Next 10


Sorting

Question

November 27, 2003

Hi, i have one question. How do i sort multi-column data on my website. For instance i have linked a DB to my webstie, N DB has 4 columns which i want to sort in different order, e.g. two in ascending order and other two in descending order, so how do i go about doing that? pls get back to me, i really need help on that.

Thanx.
Dave.

Dave -

1392

Answer

Suppose you enter ACTION.CFM by submitting a form from FORM.CFM. You set up your query in the action page as follows:




SELECT *
FROM invoices
WHERE company = '#url.company_sort#'
ORDER BY '#url.sortby#'





SELECT *
FROM invoices
WHERE company = '#form.company#'
ORDER BY company




Then in the title row of your table:



Name
Name

etc.



The content of your table is as you have it.

Clicking on a title will re-do the query, ordering by the item listed.

I hope that works out for you.

Back to top

Next 10

Summary

Hopefully, this reader feedback has helped provide information about ColdFusion issues.


Always do your best


Resources

The following are some resources on this topic.

Websites

ColdFusion Resources

Books

Top-rated books on ColdFusion


What do you think?

Do you have any questions, comments, or opinions on this subject? If so, send an email with your feedback. We will try to get back to you as soon as possible.

Feel free to establish a link from your website to pages in this site.


Where can you go from here?

School for Champions

ColdFusion topics

Answers to Readers' Questions


The School for Champions helps you become the type of person who can be called a Champion.