T-SQL Help, update based on current value

  • I have some data that got written with opposite values. I need to figure out how to switch the values. Basically, for a date, I need to set the Y's to N's and the N's to Y's. Can somebody show me how to do this? Thanks.

  • Was thinking something like this would work?

    update SECO_GLTRANS set Processed_Flag = (case WHEN Processed_Flag 'Y' THEN 'Y' ELSE 'N' END) WHERE Posting_Date = '20090329'

  • That would work, but you'd switch your then and else clauses.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply