This SQL:
select FORMAT(lNum,'##-###-##-###')
from [rpt].[myView]
Produces the following error:
Argument data type varchar is invalid for argument 1 of format function.
lNum is a varchar(10)
Running SQL Server 2012
This SQL:
select FORMAT(lNum,'##-###-##-###')
from [rpt].[myView]
Produces the following error:
Argument data type varchar is invalid for argument 1 of format function.
lNum is a varchar(10)
Running SQL Server 2012
varchar isn't supported as the first argument to FORMAT. The only categories of datatypes supported are Date and Time and Numeric.
You could do
select FORMAT(cast(lNum as numeric),'##-###-##-###') from [rpt].[myView]
From levelonehuman's comment : Documentation