este.....sip pero eso esta sencillo amigo es con un substring, o con un right o hay diferentes metodos, pero como veo que no se te da la investigacion aqui esta la solucion:
Código SQL:
Ver originalDECLARE @IdWagerParlay VARCHAR(MAX)
SET @IdWagerParlay=''
SELECT @IdWagerParlay = @IdWagerParlay + CONVERT(VARCHAR(20),D.[IdWager]) + ',' FROM WAGERDETAIL D, WAGERHEADER H, GAME G, PERIOD P, AGENT A, WAGERTYPE W
WHERE D.[IdWager] = H.[IdWager] AND
D.[IdGame] = G.[IdGame] AND
H.[IdAgent] = A.[IdAgent] AND
H.[IdWagerType] = W.[IdWagerType] AND
D.[IdSport] = P.[IdSport] AND
D.[Period] = P.[NumberOfPeriod] AND
W.[Description] LIKE '%PARLAY%' AND
H.[SettledDate] >= CONVERT(datetime,('2014-01-16 00:00:01')) AND
H.[SettledDate] <= CONVERT(datetime,('2014-01-16 23:59:59')) AND
H.[IdAgent] = 5039
GROUP BY D.[IdWager]
SET @IdWagerParlay=SUBSTRING(@IdWagerParlay,1,len(@IdWagerParlay)-1)
PRINT @IdWagerParlay