Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Table so lookup info is presented Alphabetically 2

Status
Not open for further replies.

n505mw

Technical User
Dec 10, 2005
7
US
Can anyone tell me the syntax to use during creating a sql table, so that when the data is referrenced it is presented Alphabetically by a certain field.?

For instance, There will be a col called "CODE", and it will contain "

(CA)
(BC)
(DC Boston)
(Brazil-NSW)

I want the data presented ALphabetically when "srel" to this table so when user clicks on field that srels to this table, the drop-down selection lists it Alphabetically like this:

(BC)
(Brazil-NSW)
(CA)
(DC Boston)

Thank you.
 
it is not how you create the table that determines the order the records are show to your users.

If you wish to have records ordered on a particular field/order, then you use the ORDER BY option of your SELECT statement

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
Thank you for reply, I dont want to query the data or report on it, Its a item to be selected and stored in a web app.

The data isnt accessed by a query, its referenced in a web app by a "Drop-Down" field in the web app that should show the list of items alphabetically by the "Code" col.
 
the drop-down has to connect to the database by means of a sql statement. if it does not then its a bound control and thats bad.change it.

Anyway that has nothing to do with ANSI SQL, so please post it on the forum related to whatever language you are using to create your web application.

Regards

Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884
FAQ181-2886
 
The only real way to ensure a particular order to data is through the use of the order by clause. Even creating a table to store the information does not guarantee that a query will return the records in the order you think they are stored in.

If you have the data in a table, you must query the database to display the data. So why do you think you are not querying it?


"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top