Problem searching for NULL values
Is it possible to search the rows in a table for null values? I've tried the following...
ALTER PROCEDURE GetApplicantsBetweenDates
(@StartDate smalldatetime,
@EndDate smalldatetime)
AS
SELECT ParticipantID, DateApplied, FirstName, LastName, City, Season, [Year], Speaking
FROM Participant
WHERE ProgramID = NULL AND (DateApplied BETWEEN @StartDate AND @EndDate)
ORDER BY DateApplied DESC
...and it returns no data (even though there are rows in the Participant table with ProgramID = NULL and within the date range).
I've tried changing the WHERE line to WHERE ProgramID = 5 AND (DateApplied BETWEEN @StartDate AND @EndDate) and it returns all the rows with program ID = 5 and within the specified date range.
Any ideas about what the problem is? Your help is greatly appreciated.
Dan
|