Este es mi select, me funciona bien,
Código SQL:
Ver originalSELECT CONVERT(VARCHAR(8), G.[GradedDate] , 108) AS 'Time',
CONVERT(VARCHAR(MAX),G.[VisitorNumber]) + '/' + CONVERT(VARCHAR(MAX),G.[HomeNumber]) AS 'NumGame', G.[VisitorTeam] + ' @ ' +G.[HomeTeam] AS 'Teams', P.[PeriodDescription],
CONVERT(VARCHAR(MAX),G.[VisitorScore]) + ' - ' + CONVERT(VARCHAR(MAX),G.[HomeScore]) AS 'Score', COUNT(*) AS 'Tickets',
SUM(H.[RiskAmount]) AS 'Risk', A.[Agent], D.[RESULT], SUM(H.[WinAmount]) AS 'Win', D.[IdGame], W.[Description]
FROM GRADEDWAGERHEADER H, GRADEDWAGERDETAIL D, GRADEDGAME G, PERIOD P, AGENT A, WAGERTYPE W
WHERE H.[IdWager] = D.[IdWager] AND
D.[IdGame] = G.[IdGame] AND
H.[IdAgent] = A.[IdAgent] AND
H.[IdWagerType] = W.[IdWagerType] AND
H.[SettledDate] >= CONVERT(datetime,('2014-01-12 00:00:01')) AND
H.[SettledDate] <= CONVERT(datetime,('2014-01-12 23:59:59')) AND
D.[IdSport] = P.[IdSport] AND
D.[Period] = P.[NumberOfPeriod] AND
H.[IdAgent] = 5585
GROUP BY G.[GradedDate], G.[VisitorNumber], G.[HomeNumber], G.[VisitorTeam], G.[HomeNumber], G.[HomeTeam],
P.[PeriodDescription], G.[VisitorScore], G.[HomeScore], A.[Agent],D.[RESULT], D.[IdGame], W.[Description]
Pero en
W.[Description] me devuelve si es "PARLAY" u otra cosa. La cuestion es que si es "PARLAY" quiero hacer otro select y lo que me devuelva ese select unirlo con este. gracias.