SQL not searching Date

I came up with an SQL to calculate the filtered values in a portal and it is working fine ...its a couple of if statements but it is working. Only problem now is I want to add one more search parameter which is to count all values greater than my global search date on the filtered portal....But I seem to be messing it up some how.