I have the following query:
SELECT
ROW_NUMBER() OVER(ORDER BY V.DATA ASC) AS ID,
V.CHAPA AS CHAPA,
F.NOME AS NOME,
V.DATA AS DATA,
CASE WHEN V.BATIDA IS NULL THEN 0 ELSE V.BATIDA END AS IS_NULL
FROM
ARELBATIDATRANSITOVIEW AS V
LEFT JOIN V_DADOSFUNC AS F ON V.CHAPA = F.CHAPA
WHERE
V.CHAPA = 2311
GROUP BY V.CHAPA,V.DATA,F.NOME,V.BATIDA
HAVING IS_NULL = '1900-01-01 00:00:00.000'
ORDER BY DATA ASC
You are returning the following message:
Message 207, Level 16, State 1, Line 42 Invalid column name 'IS_NULL'.