|
-
Oct 1st, 2004, 06:51 AM
#1
Thread Starter
Fanatic Member
Syntax help?
I need help with a SQL statement.
I need to update TWO tables in one go! The two tables are called tbl_ManifestDet and tbl_Accounts.
Here is my statement below. Currently it updates my first table called tbl_ ManifestDet with a dexcode and AccountNo. I need to update the field called "manifested" & set it to "N" in another table called tbl_Accounts. How do i write this?
VB Code:
strSQL = "UPDATE tbl_ManifestsDet SET dexcode = '" & reason & "', manifested = 'N' WHERE AccountNo = '" & Mem(SockNr) & "'"
adoConn.Execute strSQL
-
Oct 1st, 2004, 07:28 AM
#2
Fanatic Member
You can also try this:
strSQL = "UPDATE tbl_ManifestsDet mD, tbl_Accounts A SET mD.dexcode = '" & reason & "', mD.manifested = 'N' WHERE A.AccountNo = '" & Mem(SockNr) & "'"
adoConn.Execute strSQL
You do need to link the tables - so where A.id = mD.id or whatever link is there
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
-
Oct 1st, 2004, 07:57 AM
#3
Thread Starter
Fanatic Member
Can i do Innerjoin?
I havent used it before? Can anyone help write it?
thanks
-
Oct 1st, 2004, 09:03 AM
#4
Fanatic Member
How do the tables link?
If you are using access - you can use the tool to generate the sql
R
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|