×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Creating Table so lookup info is presented Alphabetically
2

Creating Table so lookup info is presented Alphabetically

Creating Table so lookup info is presented Alphabetically

(OP)
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.

RE: Creating Table so lookup info is presented Alphabetically

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
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: Creating Table so lookup info is presented Alphabetically

(OP)
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.
 

RE: Creating Table so lookup info is presented Alphabetically

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
www.syssoft-int.com

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: Creating Table so lookup info is presented Alphabetically

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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close