" ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_F_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n"+
" ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_F_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n"+
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_F_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n"+
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_F_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n"+
" AND temp1.MaterialCode = temp2.MaterialCode \n"+
" AND temp1.MaterialCode = temp2.MaterialCode \n"+
" ( SELECT SUM ( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_H_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n"+
" SELECT\n"+
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n"+
" SUM( Qty ) SettleQty,\n"+
" AND temp1.MaterialCode = temp2.MaterialCode \n"+
" HQHKanBan,\n"+
"WHERE\n"+
" MaterialCode \n"+
" temp1.SettleQty!= ISNULL(temp2.Qty,0)";
" FROM\n"+
" Set_HQ_H_Platform where version='{0}'\n"+
" GROUP BY\n"+
" HQHKanBan,\n"+
" MaterialCode \n"+
" ) temp1\n"+
" LEFT JOIN (\n"+
" SELECT\n"+
" SUM( Qty ) Qty,\n"+
" Kanban,\n"+
" MaterialCode \n"+
" FROM\n"+
" Set_HQ_H_Kanban \n"+
" GROUP BY\n"+
" Kanban,\n"+
" MaterialCode \n"+
" ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n"+
" AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty ";
" ( SELECT SUM ( Qty ) SettleQty, HQMKanBan, MaterialCode FROM Set_HQ_M_Platform WHERE version = '{0}' GROUP BY HQMKanBan, MaterialCode ) temp1\n"+
" ( SELECT SUM ( Qty ) SettleQty, HQMKanBan, MaterialCode FROM Set_HQ_M_Platform WHERE version = '{0}' GROUP BY HQMKanBan, MaterialCode ) temp1\n"+
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_M_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQMKanBan = temp2.Kanban \n"+
" LEFT JOIN ( SELECT SUM ( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_M_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQMKanBan = temp2.Kanban \n"+
" AND temp1.MaterialCode = temp2.MaterialCode \n"+
" AND temp1.MaterialCode = temp2.MaterialCode \n"+