Basic MSSQL Query help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sethupathy22
    New Member
    • Feb 2008
    • 4

    Basic MSSQL Query help

    Hi guys,

    i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

    i have values in code rows and i have a choise box with actif and inactif named member

    I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

    Can someone help

    Thank you
  • ck9663
    Recognized Expert Specialist
    • Jun 2007
    • 2878

    #2
    Originally posted by sethupathy22
    Hi guys,

    i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

    i have values in code rows and i have a choise box with actif and inactif named member

    I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

    Can someone help

    Thank you
    Do you have two tables? You said " depending on the value of another row". Would you mind posting your sample data and your desired results?

    -- CK

    Comment

    • JovieUrbano
      New Member
      • Feb 2008
      • 8

      #3
      Originally posted by sethupathy22
      Hi guys,

      i need to change (i guess update) the value on a specific row depending on the value of another row. Let me be more clear.

      i have values in code rows and i have a choise box with actif and inactif named member

      I need to set member to actif if there is any type of value in code. i have over 700 to change the value i dont want to do them manually.

      Can someone help

      Thank you

      try this

      update <table> set memberstatus='i nactif' --- set all members to inactif
      update <table> set memberstatus='a ctif'
      where valuesINcodeROW S not in ('', ' ', NULL)

      hope this helps

      Comment

      Working...