Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Issue with null field in select statment where clause

I am having an issue with a where clause. I am trying to filter job selection based on the closed date. If the job is open, then this field is blank. I want jobs that have been closed >= to this year, or open jobs that have not been closed.

The following is not working.

FROM ... where year(closeddate)>=2012 or Isnull(closeddate) ;

I have also tried:

FROM ... where year(closeddate)>=2012 or Isnull(closeddate)=-1 ;

FROM ... where year(closeddate)>=2012 or len(closeddate)=0 ;

Any one have any ideas?

1 Solution

Accepted Solutions
Not applicable
Author

I found the solution:

FROM ... where year(closeddate)>=2012 or closeddate IS NULL;

View solution in original post

3 Replies
Not applicable
Author

Hi!

Can u upload ur App. ?

Not applicable
Author

I am not able to upload the app.

This is the error I get when I try and use FROM ... where year(closeddate)>=2012 or Isnull(closeddate) ;

ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: The isnull function requires 2 argument(s).

Not applicable
Author

I found the solution:

FROM ... where year(closeddate)>=2012 or closeddate IS NULL;