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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluded Field Criteria also Excludes Nulls 1

Status
Not open for further replies.
Sep 11, 2008
25
US
CRYSTAL 11

We have Products broken down by Model/Version. Some of our NCID Product Model/Versions are blank. I am attempting to print all records that have the Product Name of "NCID" where the Product Model/Version does not include "NG". In other words, I want all NCID Product Names where the Product Model/Version is either blank or = "7.x."

My formula below results in only the "7.x" Product Model/Version records but doesn't include the nulls.

{HPD_Help_Desk.Company} = "ITS Service Desk" and
{HPD_Help_Desk.Reported Date} > DateAdd ("d", -49,{@SpecificDate} ) and
{HPD_Help_Desk.Reported Date} < {@SpecificDate} and
{HPD_Help_Desk.Product Model/Version} <> "NG" and
{HPD_Help_Desk.Product Name} = "NCID"

If anyone could please tell me what is wrong with my logic above, I'd appreciate it.
 
Hi,
In case your database treats blanks as NULLs then this should do it:
Code:
(
IsNull({HPD_Help_Desk.Product Model/Version}) 
OR
Trim({HPD_Help_Desk.Product Model/Version}) = ""
OR
{HPD_Help_Desk.Product Model/Version} <> "NG"
 )
AND
{HPD_Help_Desk.Company} = "ITS Service Desk"
 and
{HPD_Help_Desk.Reported Date} > DateAdd ("d", -49,{@SpecificDate} )
 and
{HPD_Help_Desk.Reported Date} < {@SpecificDate} and
and
{HPD_Help_Desk.Product Name} = "NCID"

NULL is an odd value and cannot be tested except as to its existance or non-existance;it is not EQUAL to anything, including itself, and is not NOT EQUAL to anything.

In CR you need to test for a NULL first.





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top