Remove the ELSE:

   MIN(CASE WHEN DATEPART(hour, FechaHora) = 0 THEN Valor END) AS [00:00],

You want NULL (the default value) so the value is ignored. By providing 0, you are assigning a known minimum value.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top