Reputation: 249
I want to replace data in a field with new data that has a URL and also add two other fields from the table. So far I have:
(replace([DBS_Cert],'pres://Default.STAFFMANAGEMENT/STAFF/',''))
This produces the file name i.e certificate.pdf
What I need is the field with the result to be:
https://s3-eu-west-1.amazonaws.com/Certificates/[ColumnField]/[ColumnField]/certificate.pdf
I can't figure out how to make add the URL and Column Fields into (replace([DBS_Cert],'pres://Default.STAFFMANAGEMENT/STAFF/',''))
Any help would be appreciated.
Thanks
Upvotes: 0
Views: 57
Reputation: 1627
Concatenate strings using '+'. And don't forget to convert types of your ColumnFields to varchar.
replace([DBS_Cert],
'pres://Default.STAFFMANAGEMENT/STAFF/',
'https://s3-eu-west-1.amazonaws.com/Certificates/' +
CAST([ColumnField] as varchar(500)) + '/' +
CAST([ColumnField] as varchar(500)) + '/certificate.pdf')
Upvotes: 1