Below is the query I am working on. I am having an issue with my IIF Statement. Please tell me what I am doing wrong? I am trying to get the query to place a "DQIP" in the Deviations_Request.Information field if the Deviations_Request.Nonadoptcomment = "Taiwan is non GC country, DQIP is not in scope for Taiwan".
SELECT Deviations_Request.AppId,
Deviations_Request.AppName,
Deviations_Request.Datastdname,
Deviations_Request.Devreqsubmitted,
Deviations_Request.Nonadoptcomment,
Deviations_Request.Nonadoptreasondesc,
Deviations_Request.[Final OA Comment],
IIF(Deviations_Request.Nonadoptcomment = "Taiwan is non GC country, DQIP is not in scope for Taiwan", Deviations_Request.Information = "DQIP", "") As Information_Column
FROM Deviations_Request
GROUP BY Deviations_Request.AppId, Deviations_Request.AppName, Deviations_Request.Datastdname, Deviations_Request.Devreqsubmitted, Deviations_Request.Nonadoptcomment, Deviations_Request.Nonadoptreasondesc, Deviations_Request.[Final OA Comment], Deviations_Request.Information;
SELECT Deviations_Request.AppId,
Deviations_Request.AppName,
Deviations_Request.Datastdname,
Deviations_Request.Devreqsubmitted,
Deviations_Request.Nonadoptcomment,
Deviations_Request.Nonadoptreasondesc,
Deviations_Request.[Final OA Comment],
IIF(Deviations_Request.Nonadoptcomment = "Taiwan is non GC country, DQIP is not in scope for Taiwan", Deviations_Request.Information = "DQIP", "") As Information_Column
FROM Deviations_Request
GROUP BY Deviations_Request.AppId, Deviations_Request.AppName, Deviations_Request.Datastdname, Deviations_Request.Devreqsubmitted, Deviations_Request.Nonadoptcomment, Deviations_Request.Nonadoptreasondesc, Deviations_Request.[Final OA Comment], Deviations_Request.Information;