Disculpa he modificado como me haz comentado pero me manda un error:
Código SQL:
Ver originalDECLARE @pFechaDel DATE = '2017-03-22'
DECLARE @pFechaAl DATE = '2017-03-22'
DECLARE @IdGuids nvarchar(MAX) = '7078a725-ca59-4b71-bc56-21b8f456d63b'
-- Facturas...
SELECT ISNULL(SUM(CH.Total),0) AS Facturas,
ISNULL(COUNT(CH.Total),0) AS CountFacturas,
(SELECT isnull(SUM(P1.Monto),0) cheques, isnull(COUNT(p1.monto),0) countcheques FROM Finanzas.PagosrecibidosCheque P1 INNER JOIN
Finanzas.PagosRecibidosHeader PR ON PR.IdGuid=P1.IdGuidHeader WHERE CONVERT(DATE, P1.Fecha , 103) BETWEEN @pFechaDel AND @pFechaAl AND
PR.IdGuidCliente IN (@IdGuids) AND IsNull(PR.PagoCancelado,0)=0)
FROM Ventas.vCalculosHeader CH
WHERE CH.TipoDocto ='V3' AND CONVERT(DATE, CH.Fecha , 103) BETWEEN @pFechaDel AND @pFechaAl AND Cancelada = 0
AND CH.ClaveCliente IN (SELECT C.Clave FROM Clientes C WHERE C.IdGuid IN (@IdGuids))
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.