Sorting in my query???

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

Guest

This is probably a very simple question and I'm sorry but I can't figure it
out. I have a query with a field named "priority" and in the "sort" line of
"priority" I have it set to ascending. I have done this before and it works
find but now when I run the query it goes in the correct order (1,2,3,4.....)
but it is at the bottom of the page. As in, if there is priority 1-4, 4 is
the last record, 3 second to last.. and so on. Any help with this would be
appreciated. Thanks.
 
I'm not sure from your post what is the problem.
If you creating a sort and you have records 1-4 and 3 is second from the
button, then that what you should get.

If the sort is wrong like 11 comes before 2, then mybe the field type is
string and this is why it happen. If that the case you can change the sort to

Order By Val(priority) Asc
 
Sorry I didn't explain my problem very well, they are in the correct order,
but I have some records that aren't numbered yet, so the non-numbered records
are showing and then the results start with 1,2,3... and so on. I want the
results to start with number "1" and then after that have the non-numbered
records show up. Thanks.
 
One method to handle this is to

Add another column for sorting (you don't need to display this column)

Field: SpecialSort: Val(Nz(Priority,99999))
Sort: Ascending

Remove the sorting from the field Priority.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Worked Perfect. Thanks a lot.

John Spencer said:
One method to handle this is to

Add another column for sorting (you don't need to display this column)

Field: SpecialSort: Val(Nz(Priority,99999))
Sort: Ascending

Remove the sorting from the field Priority.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top