How to update a column.which is having 2 conditions?

Answered How to update a column.which is having 2 conditions?

  • Monday, February 04, 2013 4:32 PM
     
     

    hi,

       a table having 3 columns as like bellow

    i want to update the validation_status value is "claimdeneid " when validationStatus  has claimdeneid and validationBilled and Cno=1

    Could you please suggest me how to write it

     Cno  ReportName  Validation_status
    1 InfuseCode ClaimDeneid
    1 DrugCode         validatebilled
    2 InfuseCode ClaimDeneid
    2 DrugCodes  ValidatedBilled
    2 HeficCode Sent  ForValidation

All Replies

  • Monday, February 04, 2013 4:38 PM
     
     Answered

    Update Table set Validation_status= Case When Validation_status in ('Claimdenied' , 'validationBilled') then 'Claimdenied' else validation_status End

    Where cNo=1


    Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

  • Monday, February 04, 2013 4:58 PM
     
      Has Code
    Update TableName set Validation_status=xxxx where validationBilled=1 and Cno=1
    If I understand it should be like above...