Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

need some help around this code

$
0
0

Hi guys

May be concept around update is not that great or I am not doing it right. Please can I have an advise around this piece of code

Your help will be appreciated

What I am trying to do is this

"

update a

set updatedatetime=getutcdate(),

loyalty_program=(case when loyalty_program='ACTIVE' then customer_state='MOD' when loyalty_program='CANCELLED' then customer_state='REM' end) from customertable a

 where customer_id=N'000000111'

"

This piece of code doesn't work , particularly it is not liking customer_state, if I put then 'MOD' it is fine but I need customer_state.

Please advise

Farhan Jamil


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>