Results 1 to 4 of 4

Thread: Syntax help?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    N.Ireland
    Posts
    651

    Question 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:
    1. strSQL = "UPDATE tbl_ManifestsDet SET dexcode = '" & reason & "', manifested = 'N' WHERE AccountNo = '" & Mem(SockNr) & "'"
    2.             adoConn.Execute strSQL
    Gilly

  2. #2
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575
    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]

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2000
    Location
    N.Ireland
    Posts
    651
    Can i do Innerjoin?

    I havent used it before? Can anyone help write it?

    thanks
    Gilly

  4. #4
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575
    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
  •  



Click Here to Expand Forum to Full Width