Affiliate report filter date SQL fix