• thanks, sounds good and I tried it.

    But both versions are not giving the result. It was no error but simply the same as if I would sort without this ISNULL or CASE statements. Maybe it has to do with the environment where I use it. I send it with MS Access 2003. Thats why I cross posted this in the Access section here. But an admi has closed it. I hope we can find the solution here.

    Here I give the full example:

    sql = "SELECT Bez, Mod, Art, Far, Count(Gro) Total

    "INTO " & t1 & "_2 " & _

    "FROM " & t1 & "_1 " & _

    "GROUP BY Bez, Mod, Art, Far " & _

    "ORDER BY CASE WHEN Bez IS NULL Then 1 ELSE 0 END, Bez, Mod, Art, Far "

    DoCmd.RunSql sql

    <t1>_1 is an existing table name, <t1>_2 is the created (sorted) table.

    by the way: how is this formatting of code section working, for me it seems it is not working ... see above.