Results 1 to 4 of 4

Thread: SQL???

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 1999
    Location
    Charleston, WV USA
    Posts
    3

    Post

    I have a database with two tables. I need to update one with and agency name. The other holds the agency names and ID numbers. How do I search the second table by ID number and to update the agency field in the first table? I tried this

    strCriteria = "SELECT Agency_Name FROM Identification WHERE ACH_ID = "'" & IDNUM "'" '

    But it doesn't work. I know little about SQL I am just trying it out. What am I doing wrong? Also, please be clear about the ' and " because it is hard to see them on the message board.

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    What error are you getting with this?

    Bash

  3. #3
    New Member
    Join Date
    Apr 1999
    Posts
    4

    Post

    The SQL should read as follows:

    strCriteria = "SELECT Agency_Name FROM Identification
    WHERE ACH_ID = '" & IDNUM & "'"

    OR

    strCriteria = "SELECT Agency_Name FROM Identification WHERE ACH_ID = " & IDNUM

    Either one of these should work.

    Hope this helps

    David Ridgway
    [email protected]

  4. #4
    New Member
    Join Date
    Apr 1999
    Posts
    4

    Post

    I'll re-send the reply and space out the one that uses ' and "".

    strCriteria = "SELECT Agency_Name
    FROM Identification
    WHERE ACH_ID = ' " & IDNUM & " ' "

    Hope this helps

    David Ridgway
    [email protected]

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