You are facing issue as you are using DATEDIFF
in ON
clause without any expression or condition.
Msg 208, Level 16, State 1, Line 6 Invalid object name 'DATEDIFF'.
that's my error string
If you want to know the difference in date then use it in the SELECT
clause.
SELECT tickets.*, ticketOperations.*,
DATEDIFF(DAY,tickets.date, ticketOperations.closingDate) AS SOLUTIONTIME
from ticketOperations
INNER JOIN tickets ON tickets.ID = ticketOperations.ticketID,
WHERE tickets.ticketType=0
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…