troubleshooting Question

Can I convert  an INSERT query which is based on a SELECT query  to become an UPDATE query.

Avatar of Issa S.
Issa S. asked on
Microsoft AccessSQL
5 Comments3 Solutions135 ViewsLast Modified:
Hi All,

I have made an APPEND (Insert)  query to update 3 values in a one record file named:  [Sanad Record-Copy]
Its SQL is:

INSERT INTO [Sanad Record-Copy] ( SumOfDrs, SumOfCrs, [Date] )
SELECT Sum([BBashit < Start Date].amount) AS SumOfDrs, Sum([BBashit < Start Date].payment) AS SumOfCrs, Max([BBashit < Start Date].Date) AS MaxOfDate
FROM [BBashit < Start Date];


This INSERT is based on the following Select SQL:

SELECT cushist.voucher, cushist.Date, cushist.caccount, cushist.daccount, cushist.amount, cushist.payment, cushist.cname, cushist.salesm, cushist.accno, cushist.remarks, cushist.pnacc, cushist.dname, cushist.ID
FROM cushist
WHERE (((cushist.Date)<[Forms]![Bashit 4 PRINTing]![StartDate]) AND ((cushist.caccount)=[Forms]![Bashit 4 PRINTing]![MFcaccount])) OR (((cushist.Date)<[Forms]![Bashit 4 PRINTing]![StartDate]) AND ((cushist.daccount)=[Forms]![Bashit 4 PRINTing]![MFcaccount]));


My Question is : Can I convert  an INSERT query which is based on a SELECT query  to become an UPDATE query to update the above 3 fields?

Thanks.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros