Re: Order by 4 columns at once

From: Tom Ellison (tellison_at_jcdoyle.com)
Date: 03/31/04


Date: Wed, 31 Mar 2004 09:05:07 -0600

Dear Michael:

First, I suggest you construct a query with a new column that gives
the value on which you would sort. Depending on your need, this might
be:

Nz(Nz(Nz(Nz(Col1, Col2), Col3), Col4), 0)

Meaning use Col1 unless it is null, in which case, use Col2 unless
that is null, etc. Use 0 if all are null.

By making this a column first, before trying to sort on it you can see
that it is doing what you really want. Then turn off displaying this
column and sort on it.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts

On Wed, 31 Mar 2004 09:22:44 -0500, "Michael Hetrick"
<m1hetric@gc.com> wrote:

>I need to generate a report from a table that may or may not have data in 4
>columns and order by those 4 columns at once.
>
>ID | Col1 | Col 2 | Col3 | Col4 | Title
>1 | 4 | | | | some text
>2 | | 2 | | | some text
>3 | | | | | some text
>4 | 9 | | | | some text
>5 | | | 7 | | some text
>
>The report should look like this:
>
>Col | Title
>2 | some text
>4 | some text
>7 | some text
>9 | some text
>
>I know that this would be easier in a relational table structure, but it
>isn't an option to design the tables correctly at this time. The final
>output will be displayed in a web page. Any assistance would be
>appreciated!
>
>Thanks -
>Michael
>



Relevant Pages

  • Re: Auto sort in real time
    ... Even though we've been talking about sorting all along, the cells containing ... They're just displaying the contents of column A in the rank of the values ... > Enter this in B1 to sort *descending*: ...
    (microsoft.public.excel.misc)
  • Re: How Much Data to Provide?
    ... is a lot more efficient than either displaying it all on one page or ... I'd also recommend implementing paging at the stored procedure instead ... sort the data - my way of thinking is if someone sorts the data and then ... Customer Type, and user wants to sort by Customer Type Description ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Unsort a valuelist
    ... valuelist regardless of how I enter them in the field. ... The only way sort a value list in a different order is to use a second ... The only problem is that these second field values are also displayed ... field on the layout grabs the related ID, while displaying the related name. ...
    (comp.databases.filemaker)
  • Re: Address Book Sorting
    ... Below is a workaround for displaying Address Book contacts in "Last, ... First format]. ... You could copy LastName FirstName into the Nickname field or a custom field, ... sort as speedily as other fields. ...
    (microsoft.public.mac.office.entourage)
  • Re: Removing sort from index
    ... query called appointmentstatus. ... There is no sort order in this query so the ... >>This is frustrating as it is not displaying records in the order they are ...
    (microsoft.public.access.formscoding)