I want to combine 2 SQL queries, the first query i want to pull back employee records for the latest month, and the second query, pull back records for the last 3 months.
There is a method to the madness, employees can change manager each month, but the latest months manager needs to see the previous 3 month records for their employee, even if that employee had a different manager for those months.
This is the 1st select to pull in latest month
/******latest month*****************/
SELECT [REPORT_DT]
,[EMPLOYEE_ID]
,[EMPLOYEE_NAME]
,[LOCATION]
,[JOB_DESCRIPTION]
,[MANAGER_ID]
FROM [EMPLOYEE]
where [REPORT_DT]=
(select max([REPORT_DT]) from [EMPLOYEE])
this is the select to pull in last 3months
/*********last 3 months*******************/
SELECT [REPORT_DT]
,[EMPLOYEE_ID]
,[EMPLOYEE_NAME]
,[LOCATION]
,[JOB_DESCRIPTION]
,[MANAGER_ID]
FROM [EMPLOYEE]
where [REPORT_DT]>=
( DATEADD(M, -3, GETDATE()))
i would be joining the 2 selects on [EMPLOYEE_ID]. Any ideas how i can combined these 2 querys? Thanks!