allow query by date

I haven't got the DB setup to test this, but thought adding in this much might save you some time :)