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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JOIN tables AND ORDER fields

Status
Not open for further replies.

Rjconrep

Technical User
Oct 24, 2000
66
0
0
US
I have joined to tables based on Group_ID. This has added nineteen different contact fields to my new table. I need to sort the contact fields according to Position order. see below
sorted by postion in the following order:
Program Director:
Operational Manager:
Medical Crew Supervisor:
Medical Director:
Chief Flight Nurse:
Chief Flight Paramedic:
Communications Supervisor:
Educational Director:
Rotor Wing Lead Pilot:
Fixed Wing Lead Pilot:
Director of Operations:
Safety Officer:
Lead Mechanic:

I assume I will have to do this during the join but am not sure how.


 
Can you please rephrase your question? I don't really understand what you are asking.

I think you are saying you have two tables, one with GroupInfo and the other with GroupContacts. These two tables are joined by the GroupId field from each field. Now you want to produce results that show are sorted based on the 13 positions listed above.

But how do these positions relate to the data?

I suggest you post back, rephrasing the question a bit and include layouts of the tables, perhaps some sample data, and expected results.

Something like

Code:
I have two tables...blahblahblah

GroupInfo Table
GroupID       PK
GroupName
GroupAddress
...

Sample
1
Flight Masters
123 Aviation Street

GroupContacts Table
ContactID    PK
GroupID    FK
ContactName
ContactPosition
...

Sample
1
1
John Jones
Safety Officer

2
1
Mark Smith
Rotor Wing Pilot

I would like to see something like:

Flight Masters Contacts
   Mark Smith    Rotor Wing Pilot
   John Jones    Safety Officer

This info will greatly help me and anyone help you to the best of our abilities. Thanks.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
If you have a table that contains the Contact information and can add a 'SORTORDER' field to that table you can order them using that field. Alternatively, create another table that has the Contact Type information with the SORTORDER field and then just JOIN into that table as part of the query as well.

Maybe posting the SQL will help too....

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
lespaul:
Thanks lespaul! That is exactly what I did and got it all to work fine.

mstrmage1768:
I suggest you post back,...blahblahblah.
Sorry you didn't understand.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top