Fordraiders
asked on
sorting and order by with nulls on the bottom after executing query
excel sql vba..
Is there a way in sql in vba to make nulls go to the bottom of the query instead of the top.
i found plety of examples but none seem to work?
for vba...
How does one use the "SWITCH" clause that includes sql with "where" statements and 3 fields to sort by ?
Is there a way in sql in vba to make nulls go to the bottom of the query instead of the top.
i found plety of examples but none seem to work?
for vba...
How does one use the "SWITCH" clause that includes sql with "where" statements and 3 fields to sort by ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
You're welcome :)
If you executing an SQL query into a dbms such as SQL Server or Oracle please provide the query and we can make recommendations. It might involve using a case expression similar to the IIF shown above e.g.
order by CASE WHEN x IS NULL THEN 'zzzzzzzzzzz' ELSE x END, ....
- but there may be other opportunities depending on the query itself and the dbms being used. (e.g. Oracle natively has NULLS First/NULLS Last)
please indicate dbms vendor and version (if this comment is relevant).