Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Unanswered: Insert into query help

    Hi

    First of all i apologise if i have posted this in an incorrect board.

    I have successfully created a query to update cells in a table but i cannot figure out how to update cells within a table that match the contents of another cell.

    Code:
    UPDATE [Asset Test Records] SET [Test Type]=REPLACE([Test Type],'95','NEW 5 AMP FUSE');
    What i want to do is find all "NEW 5 AMP FUSE" in [Test Type] cell that have a null value in [Value] and change it to "0.1" and the cell [Unit] to "£" if that makes any sense.

    Any help greatly appreciated

    Noel

  2. #2
    Join Date
    Mar 2007
    Location
    Holmestrand, Norway
    Posts
    332
    You should have the condition (Test Type equal to your string) in a where clause, and assign the new value as part of the SET clause.
    Ole Kristian Velstadbråten Bangås - Virinco - MSSQL.no - Facebook - Twitter

Posting Permissions

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