fixed date where clause issues.