Query Builder - Fix Date sort fields and format returned query