View Full Version : Help with Select Query


EducatorChris
12-15-2006, 12:19 PM
I am setting up a select query to tell me when my employees are past due for competencies. I currently have the Grade column set as a string, so that it can either read their grade or 'EXEMPT' if they have been exempted from testing.

In my query, I have a line that reads (essentially):

WHERE [ME]![Grade]<>'EXEMPT'

However, this kicks out a false for everyone who has a Null string (meaning they haven't taken their first test yet) for [Grade]. I think this because <> compares a null result to 'EXEMPT' and returns null instead of false.

Is there a way around this that doesn't involve putting in a false value in all employee records?

boblarson
12-15-2006, 01:40 PM
Try this:

WHERE [ME]![Grade]<>'EXEMPT' OR IsNull([Me]![Grade])


EDIT: Thinking about it a little more you might need:

WHERE [ME]![Grade]<>'EXEMPT' OR [Me]![Grade] <> ""