Question : How would I only select records from today going back a year,  so I would have data for a whole year?

I have an sql statement:
SELECT Emp_Name, Hire_Date, datepart([Year],Hire_Date) as YYYY, datepart([Month],Hire_Date) as MM
FROM Table1

How would I only pull records starting today (7/19/2010) going back a year (6/1/2009)  (so I would have a years data) in a WHERE clause.

I don't know if this would make a difference (YYYY varchar 4, MM int 4)

Answer : How would I only select records from today going back a year,  so I would have data for a whole year?

try the below
1:
2:
3:
SELECT Emp_Name, Hire_Date, datepart([Year],Hire_Date) as YYYY, datepart([Month],Hire_Date) as MM
FROM Table1
where Hire_Date >= dateadd(m, datediff(m, 0, getdate())-13, 0)
Random Solutions  
 
programming4us programming4us