Solved

Query not updateable

Posted on 2006-06-19
9
246 Views
Last Modified: 2008-03-03
My table maintains a log of commission changes. Fields are CommID (Primary Key, AutoNumber), Date, AccountID and CommAmt.

I use this query named "qryAcctComm" to pull the most current CommID:
SELECT tblCommissions.AccountID, Max(tblCommissions.CommID) AS MaxOfCommID
FROM tblCommissions
GROUP BY tblCommissions.AccountID;

When I create any other query based on qryAcctComm for example:
SELECT tblCommissions.CommID, tblCommissions.BaseComm
FROM tblCommissions INNER JOIN qryAcctComm ON tblCommissions.CommID = qryAcctComm.MaxOfCommID;

I cannot make updates. I am looking to update BaseComm. I assume it is because of the Max function on the Comm ID. I know I can VBA my way around this but I figured there must be a way to create an updateable query for this.
0
Comment
Question by:PaulStu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 16936970
>I assume it is because of the Max function on the Comm ID.
Correct.  Using aggregate functions in a query make it non-updatable.
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 16937157
Dont know if this makes it updatable, but try this

SELECT AccountID, CommID
FROM tblCommissions
WHERE CommID IN (SELECT Max(CommID) FROM tblCommissions)
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 16937179
try this:

SELECT tblCommissions.CommID, tblCommissions.BaseComm
FROM tblCommissions where tblCommissions.CommID in (Select MaxOfCmmid from qryqryAcctComm)

This should be updateable.

AW
0
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 250 total points
ID: 16937187
oops, fix that to read:

SELECT tblCommissions.CommID, tblCommissions.BaseComm
FROM tblCommissions where tblCommissions.CommID in (Select MaxOfCmmid from qryAcctComm)


AW
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 16939677
ok, so why only a grade of C?  I will be very cautious about offering you answers in the future.

AW
0
 

Author Comment

by:PaulStu
ID: 16943073
Thanks for making my first experience at posting a question a negative one.
1) You got the points for what turned out to be a pretty easy question.
2) You had spelling errors in your answer even after you attempted to correct it which I had to correct before I could apply your suggestion.
3) You gave me no explanation of your answer so it does not help me learn from the scenario.

So yes Arthur Wood - GRADE C Average Response for just providing the minimal answer.
I wish I knew how to email or draw the attention to the moderator for your threat!
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 16944884
One would normally ask for additional information if it was deemed to be necessary.  I tend to be rather terse in my answers, and someone who gives a grade of C is almost universally seen as not warrnating further assistance.  We are all volunteers, and I don't 'need' the points (after all, with 10,000,000 points and $4.50 I can go to Starbucks and get a Tall Mocha Latte).

You are definitly now on my 'do not help' list.  ( I was only being 'cautious' before this)

AW
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question