Fix query result for sales reporting