Ver Mensaje Individual
  #13 (permalink)  
Antiguo 26/07/2012, 17:55
mrprogman
 
Fecha de Ingreso: junio-2011
Mensajes: 329
Antigüedad: 12 años, 10 meses
Puntos: 2
Respuesta: Buscar dato en cadena Separada por Comas

ok...estoy haciendo unos cambios..para que me pueda leer de la tabla..

declare @valor nvarchar
declare @consulta nvarchar
declare @consulta2 nvarchar
SET @consulta = (SELECT paytype FROM sales2 where TYPE='2' and idate>='2012-07-24' and idate<='2012-07-24')
SET @consulta2 = (SELECT payamt FROM sales2 where TYPE='2' and idate>='2012-07-24' and idate<='2012-07-24')

SELECT @valor=id FROM [SplitApplication](@consulta) WHERE DATA LIKE '%2%'
SELECT * FROM [SplitApplication](@consulta2) WHERE id=@valor

pero me marca este error


Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Msg 512, Level 16, State 1, Line 7
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.


le voy a seguir buscando..pero es correcta la logica que estoy usando..?..gracias