January 12, 2005 at 11:32 am
Can anyone help me to get this SELECT query turned into the proper MS SQL 7 UPDATE Query. End result should SET ap_dept1113.scan_op = 'FirstName LastName
select ap_dept1113.ck_num, ap_dept1113.scan_op, o_file.fileid, o_file.ownerid,
o_file.mactype, o_file.ownerid
from ap_dept1113, o_file
where ap_dept1113.o_objid = o_file.fileid
and o_file.ownerid = '1051'
order by ck_num
Thank you.
January 12, 2005 at 12:34 pm
First off where does firstname last name come from?
I asume from your query it will be from the o_file table possibly but I don't see a column that says it would be the one.
Then you basics will look like this.
UPDATE
ap_dept1113
SET
scan_op = o_file.whatevercolumngoeshere.
FROM
dbo.ap_dept1113 ap_dept1113
INNER JOIN
dbo.o_file o_file
ON
ap_dept1113.o_objid = o_file.fileid
WHERE
o_file.ownerid = '1051'
ORDER BY
ck_num
January 13, 2005 at 11:34 am
First name Last name comes from another table called o_user2 column name lname, column name fname.
January 13, 2005 at 11:42 am
The you just need to add that into the joins in the from section (test with a Select statement first and do just like I noted with that additionally.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy