Remove SELECT
I tried that but I got a different error. I am not super at SQL so your assistance is appreciated
You have an extra ")"
Use the convention of table.field in place of where you have the field CONTRACT and take out the SELECT & the FROM PMTRAN. It should look like below. However, it be might easier to just to use the field FMTCONTNO, since that is the formatted contract number so it usually has the dashes already in place for most companies.
SUBSTRING(PMTRAN.CONTRACT,1,3)+'-'+SUBSTRING(PMTRAN.CONTRACT,4,3)+'-'+SUBSTRING(PMTRAN.CONTRACT,7,2)+'-'+SUBSTRING(PMTRAN.CONTRACT,9,3)+'-'+SUBSTRING(PMTRAN.CONTRACT,12,4)
Thank you, you will note that the number of characters being split up is 15 and the max for a Contract number is 16 including dashes. So that is 19 in total. So what the client wants will not work and I was looking for an alternative. I will try your string and see if that works.
Thank you Gabriela your SQL String worked perfectly and achieved the Goal I wanted. It also helped with another substring process I had to deal with so again greatly appreciated
*Community Hub is the new name for Sage City