Added daterange to db query and testing functionality for this