Updateable Query ACC2013

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Updateable Query ACC2013

Post by Michael Abrams »

Based on this query, I need to update the [DelayReason] to “Performance Issue”

I tried changing it to an update query but message “Operation must use an updateable query.

Not sure how to do that.

Code: Select all

SELECT dbo_FullEVTS.RecordNumber, dbo_FullEVTS.TypeOfRequest, dbo_FullEVTS.TAT, dbo_FullEVTS.Finalizer, dbo_FullEVTS.DelayReason, dbo_FullEVTS.DateIn, dbo_FullEVTS.DateCompleted, dbo_FullEVTS.Deleted, dbo_FullEVTS.Outcome
FROM dbo_FullEVTS
WHERE (((dbo_FullEVTS.RecordNumber)>151260) AND ((dbo_FullEVTS.TypeOfRequest) Like "Routine*") AND ((dbo_FullEVTS.TAT)>5) AND ((dbo_FullEVTS.DelayReason) Is Null) AND ((dbo_FullEVTS.Deleted)=False) AND ((dbo_FullEVTS.Outcome) Not Like "p*")) OR (((dbo_FullEVTS.RecordNumber)>151260) AND ((dbo_FullEVTS.TypeOfRequest) Like "URGENT*") AND ((dbo_FullEVTS.TAT)>1) AND ((dbo_FullEVTS.DelayReason) Is Null) AND ((dbo_FullEVTS.Deleted)=False) AND ((dbo_FullEVTS.Outcome) Not Like "p*"));
Thank you for helping

Michael

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Updateable Query ACC2013

Post by HansV »

Does this fail with the same error message?

UPDATE dbo_FullEVTS SET dbo_FullEVTS.DelayReason="Performance Issue"
WHERE dbo_FullEVTS.RecordNumber>151260 AND dbo_FullEVTS.TypeOfRequest Like "Routine*" AND dbo_FullEVTS.TAT>5 AND dbo_FullEVTS.DelayReason Is Null AND dbo_FullEVTS.Deleted=False AND dbo_FullEVTS.Outcome Not Like "p*" OR dbo_FullEVTS.RecordNumber>151260 AND dbo_FullEVTS.TypeOfRequest Like "URGENT*" AND dbo_FullEVTS.TAT>1 AND dbo_FullEVTS.DelayReason Is Nul AND dbo_FullEVTS.Deleted=False AND dbo_FullEVTS.Outcome Not Like "p*"
Best wishes,
Hans

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Re: Updateable Query ACC2013

Post by Michael Abrams »

Error message:
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Updateable Query ACC2013

Post by HansV »

Ah sorry.

UPDATE dbo_FullEVTS SET dbo_FullEVTS.DelayReason="Performance Issue"
WHERE dbo_FullEVTS.RecordNumber>151260 AND dbo_FullEVTS.TypeOfRequest Like "Routine*" AND dbo_FullEVTS.TAT>5 AND dbo_FullEVTS.DelayReason Is Null AND dbo_FullEVTS.Deleted=False AND dbo_FullEVTS.Outcome Not Like "p*" OR dbo_FullEVTS.RecordNumber>151260 AND dbo_FullEVTS.TypeOfRequest Like "URGENT*" AND dbo_FullEVTS.TAT>1 AND dbo_FullEVTS.DelayReason Is Null AND dbo_FullEVTS.Deleted=False AND dbo_FullEVTS.Outcome Not Like "p*"
Best wishes,
Hans

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Re: Updateable Query ACC2013

Post by Michael Abrams »

Darn.
The code generates this message:
Operation must use an updateable query

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Updateable Query ACC2013

Post by HansV »

Does your SQL Server table have a unique index (primary key, identity field)?
Best wishes,
Hans

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Re: Updateable Query ACC2013

Post by Michael Abrams »

dbo_FullEVTS has no primary key

User avatar
HansV
Administrator
Posts: 78391
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Updateable Query ACC2013

Post by HansV »

That explains it - a SQL Server table without a unique index cannot be updated from Access. You'll have to add a unique index.
Best wishes,
Hans

User avatar
Michael Abrams
4StarLounger
Posts: 573
Joined: 10 Feb 2010, 17:32

Re: Updateable Query ACC2013

Post by Michael Abrams »

OK Thanks !