I a having 2 table in sql 1 mst and 2 dtl

master is having(single record for itemcode)
itemcode,itemtype,itemname

detail is having(multiple records for singel itemcode)
itemcode, qty,

i am creating a report with itmecode ,itemtype, itemname, and the qty will be sum of multiple record from detail
the report should be group on itemtype, and itemcode is for sum(qty) from detail i dont want detail in report but the sorting order i want to have
itemtype,itemname

but when i am having gorup on itemtype ,itemcode the sort order is also
itemtype ,itemcode even if i change in sql query order by itemtype ,itemname
when is restart the report it comes back to itemtype, itemcode