Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Update statement error

    I need to insert data in two fields one is StateServicesCovered the other StateCategory but only the ones where the the CatagoryForHours = ITP and ServicesCovered = Career Training Plan. when I did a query I got about 1333 records taht fit that critera, but How to do I get the

    StateServicesCovered = Counseling

    StateCategory = Individual-Academic Progress hours

    How do I insert those values based on the critera for the Catagoryforhours (ITP) and ServicesCovered (Career Training Plan)

    Is that an Insert Statement???



    got an error message when I exectued this

    Msg 207, Level 16, State 1, Line 1
    Invalid column name 'Individual'.


    Code:
    UPDATE    TanfActivity_tbl
    SET   StateServicesCovered = 'Counseling', -- assign a fixed value to the column
    StateCatagory =  Individual - '[Individual - Personal Adjustment Hours]' -- assign a calculated value based on the difference of the values in column Individual and [Academic Progress hours] 
    WHERE     (Catagoryforhours = N'ITP') AND (ServicesCovered = N'Counseling')

  2. #2
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Nevermind I know where I made a mistake
    StateCatagory = 'Individual - Personal Adjustment Hours'

Posting Permissions

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