Good Afternoon. I am getting an error "Invalid use of Null" on my query. I am trying to add a filter where the date is in the future in the Expr1: CDate([HrgDate]) column. This column hrgdate, is being formatted as a string in the database and so I'm trying to convert it to a date and then use >date() to find the values that are in the future. My SQL code is below. Can anybody please lend assistance? Thank you!
Code:
SELECT dbo_Entities.EntityID AS [File#], CDate([HrgDate]) AS Expr1
FROM (dbo_Entities LEFT JOIN dbo_FCLIT ON dbo_Entities.EntityNum = dbo_FCLIT.Entitynum) LEFT JOIN dbo_Action_Hrg ON dbo_FCLIT.LookupAnchor = dbo_Action_Hrg.LookupAnchor
WHERE (((dbo_Entities.ClosedFlag)=0) AND
((dbo_Entities.DateClosed) Is Not Null) AND
(dbo_FCLIT.StartAction) Is Not Null) AND
((dbo_FCLIT.End) Is Null) AND
((dbo_Entities.EntityID) Not Like "*TEST*") AND
((CDate([HrgDate]))>Date()));