I would have stored Breakfast, Lunch and Dinner in a single table (with a column to indicate which meal it was
), but you can fake that with a UNION:SELECT Meal, ID, MAX(MaxDate) AS MaxDateFROM( SELECT 'Breakfast' AS Meal, ID, MAX([Date]) as MaxDate FROM Breakfast GROUP BY ID HAVING MAX([Date]) < DATEADD(Day, -3, GetDate()) UNION ALL SELECT 'Lunch' AS Meal, ID, MAX([Date]) as MaxDate FROM Lunch GROUP BY ID HAVING MAX([Date]) < DATEADD(Day, -3, GetDate()) UNION ALL SELECT 'Dinner' AS Meal, ID, MAX([Date]) as MaxDate FROM Dinner GROUP BY ID HAVING MAX([Date]) < DATEADD(Day, -3, GetDate())) AS X