Orderby high medium low

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to order a make-table query by high, medium, and then low.

The basic sorting option would do this alphabetically which is no good. Can
someone provide a simple (I think using the orderby) expression to add this
in, so that it doesn't have to be done manually after the event when I export
to excel.

Many thanks

F0zz
 
Instead of using high, medium, low use 1,2,3

if high, medium and low are already in your data, replace your field with
something like:

iif([MY_FIELD] = "high",1,iif([MY_FIELD] = "medium,2,iif([MY_FIELD] =
"low",3,9999)))

then sort on it.
 
If the words are only High, Medium, Low something like the following will
work with the proper field and table names. It's ugly, but can get the job
done:

SELECT tblHighMediumLow.*
FROM tblHighMediumLow
ORDER BY Right([Sorting],1);

HOWEVER you might be a little disappointed by the final results. Tables have
no real sort order. Even if you pour the records into the new table in a
certain order using a make-table or append query, there's no guarantee that
they will stay that way inside the table.

Instead of pouring these records into a new table, just use something like
the above query to export them to Excel.
 
missed a quote after medium..

iif([MY_FIELD] = "high",1,iif([MY_FIELD] = "medium",2,iif([MY_FIELD] =
"low",3,9999)))


Lance said:
Instead of using high, medium, low use 1,2,3

if high, medium and low are already in your data, replace your field with
something like:

iif([MY_FIELD] = "high",1,iif([MY_FIELD] = "medium,2,iif([MY_FIELD] =
"low",3,9999)))

then sort on it.


F0zziebear said:
Hi,

I want to order a make-table query by high, medium, and then low.

The basic sorting option would do this alphabetically which is no good. Can
someone provide a simple (I think using the orderby) expression to add this
in, so that it doesn't have to be done manually after the event when I export
to excel.

Many thanks

F0zz
 
Lance,

The fields you a drop-down menu of high medium and low.

I want to check do you mean instead of [My_Field] do I put in the Priority
(which is the field name?)

F0zz

Lance said:
Instead of using high, medium, low use 1,2,3

if high, medium and low are already in your data, replace your field with
something like:

iif([MY_FIELD] = "high",1,iif([MY_FIELD] = "medium,2,iif([MY_FIELD] =
"low",3,9999)))

then sort on it.


F0zziebear said:
Hi,

I want to order a make-table query by high, medium, and then low.

The basic sorting option would do this alphabetically which is no good. Can
someone provide a simple (I think using the orderby) expression to add this
in, so that it doesn't have to be done manually after the event when I export
to excel.

Many thanks

F0zz
 
Yeah, just replace "My_Field" with your field name and it should replace the
value with a 1,2,3 or 9999 ( if no matches ).

F0zziebear said:
Lance,

The fields you a drop-down menu of high medium and low.

I want to check do you mean instead of [My_Field] do I put in the Priority
(which is the field name?)

F0zz

Lance said:
Instead of using high, medium, low use 1,2,3

if high, medium and low are already in your data, replace your field with
something like:

iif([MY_FIELD] = "high",1,iif([MY_FIELD] = "medium,2,iif([MY_FIELD] =
"low",3,9999)))

then sort on it.


F0zziebear said:
Hi,

I want to order a make-table query by high, medium, and then low.

The basic sorting option would do this alphabetically which is no good. Can
someone provide a simple (I think using the orderby) expression to add this
in, so that it doesn't have to be done manually after the event when I export
to excel.

Many thanks

F0zz
 

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

Back
Top