Results 1 to 3 of 3

Thread: SQL? (2000)

  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL? (2000)

    Hi, have a table , customers, with surname/forename/team ID/logon then a second table ,customers2, with surname/forename/logon. I need to import the logon from customers2 to customers (customers has the logon field but no data in there). There is a spanner in the works in that there are more customers entered in customers2 than there are in customers (all customers in customers are in customers2 however). I have no issues with all customers 2 coming in to customers . How (if this makes sense) can I achieve my objective?

    Thanks Darren.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: SQL? (2000)

    What you need in an UPDATE query joining both tables on Surname/Forename (or is there some ID field you could use) and just update the logon field if it's Null.

    Something like:
    UPDATE Customer INNER JOIN Customer2 ON Customer.Surname = Customer2.Surname AND Customer.Forename = Customer2.Forename
    SET Customer.Logon = Customer2.Logon
    WHERE Customer.logon is Null

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL? (2000)

    Thanks Patt, I will give that a try when back at work tomorrow.

    Darren.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •