Had to rewrite this with sqlagg filters so that I could append the fancy date filter later.