You should almost always avoid changing dates into strings! Try to work with dates *AS DATES* and if you can't do that then work with them as numbers.
What DB is this?? Probably Oracle?
So see if Oracle doesn't have a better way to do this.
For example:
Code:
SELECT ...
WHERE T1.date >= TO_DATE('20090101') AND T1.date < TO_DATE('20090301')
...
See that? >= January 1st but < March 1st. Now it works even if T1.date includes both date and time.