[AccessD] Sort Blanks to the bottom

Steve Schapel miscellany at mvps.org
Sun Nov 2 16:27:34 CST 2008


Hi Rocky,

Yes it will sort the Nulls to the bottom.

But the non-Nulls will be sorted according to the Class value, which is 
not what will happen with:
SELECT VarietyTBL.VarietyID, VarietyTBL.Class, VarietyTBL.Variety
FROM VarietyTBL
ORDER BY IIf(IsNull(Class),2,1), VarietyTBL.Variety

or with:
SELECT VarietyTBL.VarietyID, VarietyTBL.Class, VarietyTBL.Variety
FROM VarietyTBL
ORDER BY IsNull(Class) DESC, VarietyTBL.Variety

Regards
Steve


Rocky Smolin at Beach Access Software wrote:
> How different?  And how come?  Wouldn't NZ(Class,9999) sort the nulls to the
> bottom? 



More information about the AccessD mailing list