Hi Folks, having error message when I try to run this query,
Error Message (The Search key was not found in any record)
But if I change the MealDate = DateAdd("M", -1, Date it works ok
DELETE *
FROM TblPatient
WHERE EXISTS
(SELECT *
FROM TblDietPlan
WHERE TblPatient.PatientID=TblDietPlan.PatientID and Discharge = Yes And MealDate < DateAdd("M", -1, Date( )));
Error Message (The Search key was not found in any record)
But if I change the MealDate = DateAdd("M", -1, Date it works ok
DELETE *
FROM TblPatient
WHERE EXISTS
(SELECT *
FROM TblDietPlan
WHERE TblPatient.PatientID=TblDietPlan.PatientID and Discharge = Yes And MealDate < DateAdd("M", -1, Date( )));