NULL's first in desc. query

  • Thread starter Thread starter Rohan via AccessMonster.com
  • Start date Start date
R

Rohan via AccessMonster.com

Hello. I have a table with dates in it, and I created a query to get all the
dates in descending order.

Access puts the empty dates/NULLS at the end, but I need them at the
beginning.

Is there any way to change the way it treats the empty dates so that they
occur first in a
descending order query ?

Rohan.
 
Dear Rohan:

If you create a new column in a query, in which nulls are changed to some
date like 12/31/2999, then sort on that column, this would do what you want.
In fact, the ORDER BY could just be:

ORDER BY Nz(YourDate, #12/31/2999#) DESC

This assumes you have no dates already in the table with such a future date
value.

Please let me know if this helped, and if you need any further assistance.

Tom Ellison
 
Back
Top