Results 1 to 3 of 3

Thread: (Resolved) Update Table Using Case

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    (Resolved) Update Table Using Case

    I am trying to do an update with the Case Statment and from everything I have read this should work.
    Code:
    UPDATE tblCouponRedeptionData_Old
    	Set MarketingLabel = CASE 
    		WHEN 'East' THEN 'East - 2'
    		WHEN 'West' THEN 'West - 2'
    		WHEN 'South' THEN 'South - 2'
    		ELSE MarketingLabel
    	End
    I am getting this error: An expression of non-boolean type specified in a context where a condition is expected, near 'THEN'.

    What am I doing wrong?
    Last edited by FastEddie; Oct 5th, 2007 at 01:47 PM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Update Table Using Case

    You did not specify a condition for the Case statement

    Code:
    Set MarketingLabel = CASE MarketingLabel
        WHEN 'East' THEN 'East - 2'
        WHEN 'West' THEN 'West - 2'
        WHEN 'South' THEN 'South - 2'
        ELSE MarketingLabel

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    Re: Update Table Using Case

    That was it. Thank you.

Posting Permissions

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



Click Here to Expand Forum to Full Width