I'm guessing the GetMaxDateForLISUpdate query joined into Get_New_PCP query is the issue. Queries involving aggregates cannot be updated. Check here for options on working around this issue.
ACCESS UPDATE OFF OF QUERY
Domanda
UPDATE dbo_enrollment AS A INNER JOIN Get_New_PCP AS B
ON A.PartD_ID = B.PartD_ID SET A.Nbr = B.['UpdatePCP'];
So Get_New_PCP is a query I run to get all the changed values from the database with the latest import file.
The error I'm getting is that I Operation must use an updateable query
...
Pretty familiar with SQL, and Access- I may have come across this issue before actually, is there any way to work around it without making a table out of the query results? I thought it would act like a view...I tried to research it, but ACCESS UPDATE QUERY in my search just returns a bunch of update query syntax...
Any help would be much appreciated.
Thanks!
UPDATE
SELECT
c.MaxLoadDate,
a.CMS_Status_Update_Date,
a.Effective_Date,
a.PBP_Nbr,
a.Unique_Member_ID AS EnrolleeID,
a.First_Name+', '+a.Surname AS Enrollee,
a.Street_Address1, a.Street_Address2,
a.City,
a.State,
a.Zip,
a.Birth_Date AS DOB,
"(" & Left(d.[Phone],3) & ")" & Mid(d.[Phone],4,3) & "-" & Mid(d.[Phone],5,4) AS PCP_PhoneNumber,
a.HIN,
a.PartD_ID,
b.[Eff Date],
b.[PID] AS ['UpdatePCP'],
a.PCP_Nbr AS ['CurrentPCP'],
IIf(c.PartD_LIPSL Is Null,'W/o LIS','LIS') AS LISStatus
FROM ((dbo_enrollment AS a INNER JOIN cards_april2014 AS b
ON a.PartD_ID = b.RecNum)
LEFT JOIN
GetMaxDateForLISUpdate AS c ON a.HIN = c.HIN)
LEFT JOIN [CCAPM2] AS d
ON a.PCP_Nbr = d.PID
WHERE (((a.PCP_Nbr)<>b.[PID]) And ((a.CMS_Status)='Enrolled'))
DESC;
Soluzione
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow