D
Dan M
I have a job positions table containing a field for last
name. There are cases when this field will be null (when
no one is assigned and the position is "open").
I'm attempting to use a SQL statement (in my adp file
pulling from SQL Server data) to display (in a listbox)
the last name of the person in the job position, or the
word "open" if there is no one. Here's my SQL for the
list box rowsource:
SELECT PositionID, JobPosition, CASE WHEN (LastName =
Null) THEN 'Open' ELSE LastName END as Name FROM
tblJobPositions
Usually, when I use the CASE WHEN syntax, I get the
desired output. But in this case, when the LastName
column is null, the output is null and my CASE WHEN logic
seems to be ignored.
I've experimented with other options to test, like
CASE WHEN (LastName = '') THEN 'Open' ELSE LastName END as
Name
and it works fine (assuming I have an empty string last
name in the table). It just has problems with NULL
values. Anyone know why?
name. There are cases when this field will be null (when
no one is assigned and the position is "open").
I'm attempting to use a SQL statement (in my adp file
pulling from SQL Server data) to display (in a listbox)
the last name of the person in the job position, or the
word "open" if there is no one. Here's my SQL for the
list box rowsource:
SELECT PositionID, JobPosition, CASE WHEN (LastName =
Null) THEN 'Open' ELSE LastName END as Name FROM
tblJobPositions
Usually, when I use the CASE WHEN syntax, I get the
desired output. But in this case, when the LastName
column is null, the output is null and my CASE WHEN logic
seems to be ignored.
I've experimented with other options to test, like
CASE WHEN (LastName = '') THEN 'Open' ELSE LastName END as
Name
and it works fine (assuming I have an empty string last
name in the table). It just has problems with NULL
values. Anyone know why?