Skip to main content
added 2 characters in body
Source Link
MonkeyZeus
  • 143
  • 1
  • 10

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2'

It would probably be helpful to explain what I am doing in the substring() function so here it goes:

Update fieldname to be itself but remove the unwanted 7 chars FY15-Q2 atfrom the end and instead concat the string with FY16-Q1

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2'

It would probably be helpful to explain what I am doing in the substring() function so here it goes:

Update fieldname to be itself but remove the unwanted 7 chars FY15-Q2 at the end and instead concat the string with FY16-Q1

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2'

It would probably be helpful to explain what I am doing in the substring() function so here it goes:

Update fieldname to be itself but remove the unwanted 7 chars FY15-Q2 from the end and instead concat the string with FY16-Q1

added 226 characters in body
Source Link
MonkeyZeus
  • 143
  • 1
  • 10

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2Q2'

It would probably be helpful to explain what I am doing in the substring() function so here it goes:

Update fieldname to be itself but remove the unwanted 7 chars FY15-Q2 at the end and instead concat the string with FY16-Q1

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2'

It would probably be helpful to explain what I am doing in the substring() function so here it goes:

Update fieldname to be itself but remove the unwanted 7 chars FY15-Q2 at the end and instead concat the string with FY16-Q1

Source Link
MonkeyZeus
  • 143
  • 1
  • 10

I use Oracle but below is how I would try it in SQL-Server:

update tablename
set fieldname = concat(substring(fieldname, 1, (length(fieldname) - 7)), 'FY16-Q1')
where fieldname like '%FY15-Q2