Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 substring function requires 3 arguments

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2007-08-30 : 09:17:06
Substring ('(' + left(@phone,3) + ')') + substring(@phone,4,3) + '-' + substring(@phone,7,4) + 'x' + right(@phone,4) getting an error on this code help please.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-08-30 : 09:21:41
You only have one argument in the first substring.

CODO ERGO SUM
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-08-30 : 09:28:43
I think that should be

'(' + left(@phone,3) + ')' + substring(@phone,4,3) + '-' + substring(@phone,7,4) + 'x' + right(@phone,4)

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -