• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Update

Hi,

how can write an update statement that would search in the churchName field that has "church" word and updated to this word
"Chr"


Update ChurchTbl
set ChurchTbl.ChurchName = (select ChurchTbl.ChurchName from ChurchTbl
where ChurchTbl.ChurchName like '%church%')

for example:

ChurchName

Ada Congregational Church
Community Reformed Church
Forest Hills Bible Chapel
Keystone Community Church

the output I need is this:

ChurchName

Ada Congregational Chr
Community Reformed Chr
Forest Hills Bible Chapel
Keystone Community Chr


0
lulu50
Asked:
lulu50
1 Solution
 
sdstuberCommented:
Update ChurchTbl
set ChurchTbl.ChurchName = replace(ChurchName,'Church','Chr')
where ChurchName like '%Church%'

0
 
JestersGrindCommented:
UPDATE ChurchTbl SET ChurchName = REPLACE(ChurchName, 'Church', 'Chr')

Greg

0
 
lulu50Author Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now