Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Trim Function

$
0
0

Hi All,

Please find below is my table script and sample data.

declare @test table
(
Account_Name VARCHAR(20) NOT NULL
,Account_ID INT NOT NULL PRIMARY KEY
,GOAL VARCHAR(50) NULL  
)
Insert into @test
Select 'Comp1',1,'.50:1'
UNION ALL
Select 'Comp2',2,'1.6:1'
UNION ALL
Select 'Comp3',3,'.50:1'
UNION ALL
Select 'Comp4',4,'1.25:1'
UNION ALL
Select 'Comp5',5,'1.25:1'
UNION ALL
Select 'Comp6',6,'1.20:1'
UNION ALL
Select 'Comp7',7,'1.00:1'
UNION ALL
Select 'Comp8',8,'1.40:1'

Select * from @test

I'm just looking to see the 'Goal column' values only before ":"

like this: 

1.6,
.50,
1.25,
1.25,
1.20,
1.00,
1.40

Thanks in Advance.


- please mark correct answers



Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>