I have this query to return records between this date to that date as following:
This won't return anything.
If the data in Between clause is of the same year, Say for instance: '12/01/2010' and '12/31/2010 then it returns data or 01/01/2011 and 01/31/2011.
But different years won't. Please help , i don't know why it is happening.
Thanks.
Code:
Select *
from Employee
where Employee_ID = 1
and convert(varchar(10), DateofVAcation,101)
between '12/01/2010' and '01/01/2011'
If the data in Between clause is of the same year, Say for instance: '12/01/2010' and '12/31/2010 then it returns data or 01/01/2011 and 01/31/2011.
But different years won't. Please help , i don't know why it is happening.
Thanks.