DI Report Writer is actually an application that uses the base of Excel to perform operations. If the Sort and Query functions are not working fine, I recommend you to check the Excel's functionality. Try to attempt a repair operation and make sure DI Report Writer has access to Excel while Excel is turned off. After all these requirements are met, the SORT and QUERY should work fine.