I have a column called FileName with values such as “100.wmv, 200.wmv, 999.wmv”, but i just want to display “100, 200, and 999″ without wmv extension.
so I just use substring to solve the problem
select substring(FileName, 1, 3) as FileName from [TableA]
Here the explaination to use : SUBSTRING(string to manipulate, start index, length of string to [...]
Archive for January 30th, 2008
substring for MSSQL
Posted in MSSQL, tagged SQL on January 30, 2008 | Leave a Comment »