Quick question, how i can use case statment in update statement or i can use or not, below is my code
Update Mytable Set Book = (Select top 1 'Book' +' '+isnull(e.book, 'No Book') From Table2 Case When isnull(e.book, 'No Book') like %No Book% then '<font Color = Red>' +e.Book + '</font>' else '<font Color=Green>'+ e.book + '</font>' )
Update Mytable Set Book = (Select top 1 'Book' +' '+isnull(book, 'No Book') From Table2 Case When isnull(book, 'No Book') like %No Book% then '<font Color = Red>' +e.Book + '</font>' else '<font Color=Green>'+ book + '</font>' )
I am updating field Book , IN case Statement i am saying if there is no Book then on front end Color change to Red if there is book Color change to Green. Please let me know if my question is not clear, I want to use this case statement in Update statement.