sort query with null values at end

J

Jennifer

I want my query to place all of the null values in the sort field at the end.
But only have ascending or descending as option. Is it possible?
 
F

fredg

I want my query to place all of the null values in the sort field at the end.
But only have ascending or descending as option. Is it possible?

Add a new column to your query:
SortMe:IIf(IsNull([SortFieldName]),2,1)
Sort this column Ascending
Move this column to the left of the [SortFieldName] column.
You can uncheck the column's Show check box

Sort [SortFieldName] Ascending
 
K

KARL DEWEY

Add a calculated field just for sorting like this --
MySort: IIF([YourField] Is Null, "Z", " ") & [YourField])
This will place a leading space if it is not null and a 'Z' if it is.
 

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

Top