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

Test nulls in query 2

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello I have run across an old problem - that of nulls and empty fields.

I want to return a yes no rersult in a query so I can quickly check if sort-codes are missing in my table.

I have entered: TEST RESULT: IsNull([Sort Code])

Thus gives the same result whether or not a value exists.

Can someone give the the correct expression to use within a query.

I have tried aslo using iff and switch functions but not getting there.

I guess ideally I would like to be able to display the words "Correct" when an entry exists and "Error" when the field is blank.

Many thanks Mark
 
If I understand, you want a query column to display when a field is either null or blank.

Code:
Test Result: IIf(Len([Sort Code]&"")= 0, "Correct","Blank")

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
I believe is the other way around:
Code:
Test Result: IIf(Len([Sort Code] & "" ) = 0, "Blank or Null", "Has Value")


---- Andy

There is a great need for a sarcasm font.
 
@Andy, good catch. I'm falling victim to multi-tasking and advancing age [bomb]


Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
As always, thank you very much and a very happy new year you both.

Regards Mark.
 
Don't you think Duane deserves a * ? [ponder]


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top