updated query for revenue with parsed dates