Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is (Null) in a query, how to use it in conjunction with more criteria 1

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
GB
Hi,
I have a bit of a frustrating problem...
I have a table with null values and True and False values(T/F)
The criteria I have put in is Is(Null).
But I also want all the false (F) displayed when the query is generated as well.
Does anyone know how to do it?
The SQL code is:

SELECT UNI7TEST_CNCODE.LISTNAME, UNI7TEST_CNCODE.CODEVALUE, UNI7TEST_CNCODE.U_VERSION, UNI7TEST_CNCODE.CODETEXT, UNI7TEST_CNCODE.CODECAT, UNI7TEST_CNCODE.HISTORIC, UNI7TEST_CNCODE.XTRATEXT
FROM UNI7TEST_CNCODE
WHERE (((UNI7TEST_CNCODE.LISTNAME)="DCAPPTYP") AND ((UNI7TEST_CNCODE.HISTORIC) Is Null) AND ((UNI7TEST_CNCODE.XTRATEXT) Not Like "Wizard Code"))
ORDER BY UNI7TEST_CNCODE.HISTORIC;


I have also excluded "Wizard Code"
Any help would be great! :)
Kind regards
Triacona
 
WHERE UNI7TEST_CNCODE.LISTNAME='DCAPPTYP' AND Nz(UNI7TEST_CNCODE.HISTORIC,False)=False AND UNI7TEST_CNCODE.XTRATEXT<>'Wizard Code'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you very much for your help [smile]
Unfortunately it still only gives me just the null values, and does not include all the F(false) values.
So I need the null values and the F(false) values to be displayed.
any more help would be greatly appreciated.

Here is the code with your additions:

SELECT UNI7TEST_CNCODE.LISTNAME, UNI7TEST_CNCODE.CODEVALUE, UNI7TEST_CNCODE.U_VERSION, UNI7TEST_CNCODE.CODETEXT, UNI7TEST_CNCODE.CODECAT, UNI7TEST_CNCODE.HISTORIC, UNI7TEST_CNCODE.XTRATEXT
FROM UNI7TEST_CNCODE
WHERE (((UNI7TEST_CNCODE.LISTNAME)="DCAPPTYP") AND ((UNI7TEST_CNCODE.XTRATEXT)<>"Wizard Code") AND ((Nz([UNI7TEST_CNCODE].[HISTORIC],False))=False))
ORDER BY UNI7TEST_CNCODE.HISTORIC;



Thank you again [smile]
 
The data type seems text ?
Code:
SELECT LISTNAME, CODEVALUE, U_VERSION, CODETEXT, CODECAT, HISTORIC, XTRATEXT
FROM UNI7TEST_CNCODE
WHERE LISTNAME="DCAPPTYP" AND XTRATEXT<>"Wizard Code" AND Nz(HISTORIC,'F')='F'
ORDER BY HISTORIC

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top