complex sorting query

R

ram8595

ost ocity dst dcity carrier price rank
a b c d opq 33 1
a b c d lmn 44 2
o r c d jjj 77 1
c d l p abc 222 1
c d l p irt 245 2
c d t s ddd 12 1

i have a table where is no sorting. now i want to sort the data in the
above form. First i need to get the rows sorted with the
dst ,dcity,ost , ocity and rank. Then the same set of dest st and dest
city could be present as ost and ocity. i want those rows to appear
next. This should be sorted as ost, ocity, dest st, dest city and
rank.

For example c(dest st) and d(dest city) come in the first three rows
and then c and d are in ost and ocity. so the fourth , fifht and sixt
rows are sorted by ost, ocity , dest st , destn city and rank. So
there are two different sorting rules here. is there any way to
accomplish this in a single sql query or design grid in access\

pls help thanks
 
K

KARL DEWEY

Create a select query and in design view drag the fields to appear in dst,
dcity, ost, ocity, rank, carrier, and price order left to right.
In the Sort row of the grid select Ascinding for dst, dcity, ost, ocity, and
rank and leave carrier and price sort blank.
 
S

subs

Create a select query and in design view drag the fields to appear in dst,
dcity, ost, ocity, rank, carrier, and price order left to right.
In the Sort row of the grid select Ascinding for dst, dcity, ost, ocity, and
rank and leave carrier and price sort blank.
--
KARL DEWEY
Build a little - Test a little








- Show quoted text -

it is not as easy .i mean first it has to get sorted by dst, dcity and
then by ost, ocity because some dst and dcity become ost and ocity and
i need those to come as next rows. pls look at the pattern of data
above

pls help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query combining the tables 15
Pls help with SQL query 12
sorting 1
SQL 2
deleting duplicates but with a condition 5
Tranportation query - interesting one 1
Query to add rows with a criteria 4
SQL 1

Top