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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Converting TSQL query to jet sql

Status
Not open for further replies.

vmchase

IS-IT--Management
Jun 12, 2008
2
US
How do I convert this query to a MS access SQL query, it is from MS SQL?

UPDATE OrderDetails
SET ShipID = LatestShipping
from OrderDetails
INNER JOIN Orders on Orders.OrderID = OrderDetails.OrderID
INNER JOIN (Select shipping.EEID ,MAX(Shipping.ShipID) AS LatestShipping
FROM Shipping GROUP BY EEID ) sub
ON Sub.EEID= Orders.EEID
Where OrderDetails.ShipID is null AND OrderDetails.Tracking is null AND OrderDetails.ShipDate is null
 
Here is the general form:
Code:
UPDATE tblA a INNER JOIN tblB b ON.......
SET a.fld = b.fld....
WHERE a.fld = b.fld

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
UPDATE OrderDetails AS D INNER JOIN Orders AS O ON D.OrderID = O.OrderID
SET D.ShipID = DMax("ShipID","Shipping","EEID=" & O.EEID)
WHERE D.ShipID Is Null AND D.Tracking Is Null AND D.ShipDate Is Null

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top