If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Help! Access Query that omits field if NULL!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-03, 11:53
jfouse jfouse is offline
Registered User
 
Join Date: May 2003
Posts: 22
Question Help! Access Query that omits field if NULL!

I need to set up a query that omits fields if NULL or empty..and thus far havent been able to do so or figure it out....youre help is greatly appreciated

thanks,

John
Reply With Quote
  #2 (permalink)  
Old 05-15-03, 06:05
Sferical Sferical is offline
Registered User
 
Join Date: May 2003
Posts: 4
Have you tried IsNull ?

In your query criteria you could put something like:

If IsNull(FieldName) = False

This would only show fields which were Not Null.

Sfez
Reply With Quote
  #3 (permalink)  
Old 05-15-03, 06:36
garethdart garethdart is offline
Registered User
 
Join Date: Sep 2002
Location: South Wales
Posts: 580
Lightbulb Is Not Null

In query design view, type:

Is Not Null

In the criteria section under the field you want to check.

This will find only records which have data in that field.

What data type is the field?
Reply With Quote
  #4 (permalink)  
Old 05-15-03, 08:34
jfouse jfouse is offline
Registered User
 
Join Date: May 2003
Posts: 22
the data is a hyperlink to a picture on my server
Reply With Quote
  #5 (permalink)  
Old 05-18-03, 10:41
ansentry ansentry is offline
Registered User
 
Join Date: Aug 2002
Location: Melbourne, Australia
Posts: 111
The answer to you question (in both posts) is NO

If a field is empty then the "Caption"(heading) will still appear in a query.

In a "single form" you can hide the control (visible=false) if it is "empty"

I think you could create a query with code that only selected fields that were "empty" but why you would want to I have no idea.

See my attached database, look at the queries and then open the form
cycle through the records and you will see that the FAX do not appear in all of them.


Hope this was of some help



John A

PS maybe you could explain what you are trying to do?
Attached Files
File Type: zip test.zip (22.2 KB, 116 views)
Reply With Quote
  #6 (permalink)  
Old 05-19-03, 10:19
jfouse jfouse is offline
Registered User
 
Join Date: May 2003
Posts: 22
I would love to see your example but it is telling me that it is read only and when I check the properties it doesnt seem to be??? I am running access xp
Reply With Quote
  #7 (permalink)  
Old 05-19-03, 13:28
popfly popfly is offline
Registered User
 
Join Date: May 2003
Location: Providence, RI
Posts: 12
Angry

If I understand what it is you are trying to do correctly, I think that what you are looking for is an SQL statement that excludes empty fields, correct?

In that case, you would use:

SELECT tbl.*
FROM tbl
WHERE [field_name] IS NOT NULL;

Give that a try and let me know if it works.
Reply With Quote
  #8 (permalink)  
Old 05-19-03, 17:52
ansentry ansentry is offline
Registered User
 
Join Date: Aug 2002
Location: Melbourne, Australia
Posts: 111
The sample was written in access 97, when you try and open it, you will be asked to either open it or convert it . The answer is up to you. If you just want to view it then just open it ( you will get a warning that it is read only) or you can convert it to xp.

The choice makes not difference, you would still be able to view. I do not have access xp, but i do have access 2000 and I both opened and converted it with this program.


John A


I have attached another copy saved in access 2000
Attached Files
File Type: zip test2000.zip (27.6 KB, 127 views)
__________________
Regards,



John A
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On