Adjusted queries for changed date type