Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update so simple in SQL - not in Access

Status
Not open for further replies.

djayam

Technical User
Joined
Aug 16, 2005
Messages
95
Location
GB
Hi all,

I'm new to Access but competent in SQL queries. I need to get this query working in Access but am failing miserably - can anyone help!?

In SQL:

UPDATE Orders


SET Delivered =
(
SELECT

SUM(Deliveries.Quantity)

FROM
Deliveries

WHERE
Orders.OrderID = Deliveries.OrderID
AND ShipDate < GetDate()
)

Copying and pasting into access gives the error "Operation must use an updateable query"

Help!! Thanks.
Jason
 
make sure you have the write permissions on the table...

-DNG
 
One way:
UPDATE Orders
SET Delivered = DSum("Quantity", "Deliveries", "OrderID=" & [OrderID] & " AND Shipdate<#" & Format(Date(),"yyyy-mm-dd") & "#")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Unbelievable. Got to say I don't really understand what you have written, but it works!!

Thank you so much and for such a quick reply.

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top