J
Judy Ward
I want a query that will output a word if a field is not null.
To be specific, I have (simplified down):
tblSCR tblDBMs_for_SCRs
------- ---------------------
SCR_ID SCR_ID
SCR_Element SCR_DBM_Actual
SCR_IR_Tag
I want to join the two tables and end up with a distinct list of Elements
that have an SCR_IR_Tag that matches the criteria I give and output the word
"Included" if the SCR_DBM_Actual is not null.
This is as far as I can get:
SELECT DISTINCT tblSCR.SCR_Element
FROM tblSCR LEFT JOIN tblDBMs_for_SCRs ON tblSCR.SCR_ID =
tblDBMs_for_SCRs.SCR_ID
WHERE (((tblDBMs_for_SCRs.SCR_DBM_Actual) Is Not Null) AND
((tblSCR.SCR_Multipurpose)="IR-11"));
I have done this in the past where one query output "Included" if the field
was not null, another query output the work "Planned" if the field was null,
and I used a union to put the two queries together--but I can't remember how
to get the query to output a word!
Does anyone know how to do this?
Thank you,
Judy
To be specific, I have (simplified down):
tblSCR tblDBMs_for_SCRs
------- ---------------------
SCR_ID SCR_ID
SCR_Element SCR_DBM_Actual
SCR_IR_Tag
I want to join the two tables and end up with a distinct list of Elements
that have an SCR_IR_Tag that matches the criteria I give and output the word
"Included" if the SCR_DBM_Actual is not null.
This is as far as I can get:
SELECT DISTINCT tblSCR.SCR_Element
FROM tblSCR LEFT JOIN tblDBMs_for_SCRs ON tblSCR.SCR_ID =
tblDBMs_for_SCRs.SCR_ID
WHERE (((tblDBMs_for_SCRs.SCR_DBM_Actual) Is Not Null) AND
((tblSCR.SCR_Multipurpose)="IR-11"));
I have done this in the past where one query output "Included" if the field
was not null, another query output the work "Planned" if the field was null,
and I used a union to put the two queries together--but I can't remember how
to get the query to output a word!
Does anyone know how to do this?
Thank you,
Judy