Case
I am not sure if the logic after the THEN is correct THEN MIN(Payroll.CheckDate), I think this will just return the first checkDate ever, and not really the first checkDate after 6 month's termination period.
Any help?
The Table structure for this is basically an Emp table with Emp info, hire date, termination Date and so on... Pay table stores info about Pay, Check Date, Amount.... for employees.