• You are converting the dates to string before comparing them, instead of comparing dates. Do it like this:

    where EffDt >= '20080601' and EffDt < '20070101'