Fixed #2983 Corrected date range queries
Merge branch 'issue/2983'