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

Using IsNull

Status
Not open for further replies.

ceciliag8

Technical User
Mar 17, 2002
4
CA
I'm having problems with IsNull. I have a table with numeric values. The query looks at the depth value, and determines how deep it is (i.e. surface, shallow, medium & deep).
There are some cells that don't have any info in them, but when I run the query, it still returns a value, such as surface, or medium, etc.

this is what my formula looks:
Depth: IIf([ALLQUAKE]![Depth]<15,&quot;Surface&quot;,IIf([ALLQUAKE]![Depth]<40,&quot;Shallow&quot;,IIf([ALLQUAKE]![Depth]<100,&quot;Medium&quot;,&quot;Deep&quot;)))

I was told to use IsNull, but I don't know how I would use it, or even the syntax of it.

Does this make sense to anyone? Can anyone help me?
 
Add this to your formula:
IIf(NOT ISNULL([ALLQUAKE]![DEPTH]), IIf([ALLQUAKE]![Depth]<15,&quot;Surface&quot;,IIf([ALLQUAKE]![Depth]<40,&quot;Shallow&quot;,IIf([ALLQUAKE]![Depth]<100,&quot;Medium&quot;,&quot;Deep&quot;))))


This says &quot;If the depth field is not null, then check the values and plug in your descriptions.

The result set will include records that have null values in the depth field. If you want to limit the results to only those records with values in the depth field then leave your formula the way it was. In a new column in your query enter:

DepthValue:[ALLQUAKE]![DEPTH]

In the criteria section enter:

Is not null

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top