Este es mi query ...
DECLARE @fecha0 datetime
SET @fecha0 = (select top 1*
FROM events
WHERE plate like '%D7Z716%' AND
CONVERT(varchar, received, 103) = CONVERT(varchar, GETDATE(), 103) AND ADDRESS LIKE '%W BAYER%')
IF EXISTS(SELECT ISNULL(MIN(received),'') AS fecha
FROM events
WHERE plate LIKE '%D7Z716%'
AND CONVERT(varchar,received,103)=CONVERT(varchar, GETDATE(), 103) AND ADDRESS LIKE '%W BAYER%')
BEGIN
SELECT TOP(1) received
FROM events
WHERE received > @fecha0
END
El error que me sale.
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.