Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Query

Posted on 2014-10-11
3
Medium Priority
?
168 Views
Last Modified: 2014-10-11
I have an Access query (below) I'd like to run in Sql Server but of course the syntax is incorrect. Can anyone help me with what it should actually be?

UPDATE tempMeals_In INNER JOIN Routes ON (tempMeals_In.ST_Site = Routes.GId) AND (tempMeals_In.mls_route_fk = Routes.MobileDeviceId) SET tempMeals_In.ST_Route = [RId];
0
Comment
Question by:SpaceCoastLife
3 Comments
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 1000 total points
ID: 40374876
is this query really valid in Access?

Try:
UPDATE tempMeals_In 
SET ST_Route = [RId]
from tempMeals_In 
INNER JOIN Routes ON (tempMeals_In.ST_Site = Routes.GId) AND (tempMeals_In.mls_route_fk = Routes.MobileDeviceId) 

Open in new window

0
 
LVL 66

Accepted Solution

by:
Jim Horn earned 1000 total points
ID: 40374888
The above answer is correct, so instead of adding two cents I'll mention If you're doing a lot of Access to SQL query conversion I have an article out there on Migrating your Access Queries to SQL Server Transact-SQL that's a grab bag of syntax differences.
0
 

Author Closing Comment

by:SpaceCoastLife
ID: 40374897
Thanks for the help. Statement ran perfectly!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

963 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