Skip to main content
Answer

Evaluate Not Null

  • February 20, 2024
  • 7 replies
  • 485 views

Forum|alt.badge.img

Hello everyone,

What is the proper syntax in the Generic Inquiry builder to evaluate if the value of a field is not null?

 

For example if I want to evalute if Inventory Item Item ID is not null...

The following does not evalute correctly:

[InventoryItem.InventoryID]<>Null

 

The following does evaluate correctly, but looking for a more direct way:

=IIF(Isnull([InventoryItem.InventoryID],0)<>0,...)

 

Thanks in advance!

Luke

Best answer by darylbowman

Null is not the same as blank, although if one formula works as ‘null’, it seems like they both should. Try this:

[InventoryItem.InventoryID]<>''

7 replies

Forum|alt.badge.img+5
  • Captain II
  • February 20, 2024

You could try inventoryID>’’    -   that’s 2 single quotes.  I believe I’ve used this before.


Robert Sternberg
Captain II
Forum|alt.badge.img+7

InventoryID is a required field from a database level as it is the primary key.  Could you share more on your reasoning for this formula as it might not be needed? 

 

Your first formula is correct FIELD <> Null is a valid expression so once we know more about use case it will be easier to determine why you are not seeing the result you expect.  

Similarly for a generic inquiry you can use the conditions tab to indicate FIELD | IS NOT EMPTY


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 21, 2024

I used InventoryID as a simple example.  My actual use case is a multi-level Kit Specification report where I am left joining KitSpecifcations on KitComponents.  I am using the null check to determine what level the component is on.

Here is an example evaluating using <>Null vs IsNull

 


darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • February 21, 2024

Null is not the same as blank, although if one formula works as ‘null’, it seems like they both should. Try this:

[InventoryItem.InventoryID]<>''


Forum|alt.badge.img
  • Author
  • Freshman I
  • February 21, 2024

Thanks @darylbowman.  Agree that null is not the same as blank, but that does work in this context. 


darylbowman
Captain II
Forum|alt.badge.img+15

It may be that IsNull checks for null or blank, whereas, an equality comparision to null will only check for null.


darylbowman
Captain II
Forum|alt.badge.img+15

@lukef55 If this is resolved, would you mark it solved by checking the box on the best answer?