A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query Question - I don't know



 
 
Thread Tools Display Modes
  #1  
Old July 3rd, 2008, 02:22 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default Query Question - I don't know

Is there a way in a query to have let's say three fields and do this:
If this field is not null OR if this field is not null OR if this field is
not null then do something? Is that possible? Thanks so much!!!!
  #2  
Old July 3rd, 2008, 02:54 PM posted to microsoft.public.access.queries
Bob Barrows [MVP]
external usenet poster
 
Posts: 441
Default Query Question - I don't know

Golfinray wrote:
Is there a way in a query to have let's say three fields and do this:
If this field is not null OR if this field is not null OR if this
field is not null then do something? Is that possible? Thanks so
much!!!!


It depends on what "doing something" means. It could very well be possible.
You are going to need to be more specific. It always helps to show us a few
rows of sample data, and then _show_ us what your desired results are.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


  #3  
Old July 3rd, 2008, 02:54 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Query Question - I don't know

Yes, if you know what to do in the negative. Note that I assume by "do
something" you mean compute something:



iif( (field1 IS NULL) AND (field2 IS NULL) AND (field3 IS NULL), NULL,
computeSomething( ) )


where computeSomething( ) can be a public user defined function, returning
some value, in a standard module, but which can do something else too, as
side effect, such as sending you an email. I assumed that in the negative,
the result to return is NULL.



Vanderghast, Access MVP


"Golfinray" wrote in message
...
Is there a way in a query to have let's say three fields and do this:
If this field is not null OR if this field is not null OR if this field is
not null then do something? Is that possible? Thanks so much!!!!



  #4  
Old July 3rd, 2008, 03:12 PM posted to microsoft.public.access.queries
Golfinray
external usenet poster
 
Posts: 1,597
Default Query Question - I don't know

I didn't explain very well, sorry. I have fields of numbers and I would like
to return records only if any one or all of the 3 fields is null. So if any
or all of the 3 fields in that record is null, I want to return that with the
query. That information will go on a report. Then I know that one or more of
them are missing. Thanks again!!!

"Michel Walsh" wrote:

Yes, if you know what to do in the negative. Note that I assume by "do
something" you mean compute something:



iif( (field1 IS NULL) AND (field2 IS NULL) AND (field3 IS NULL), NULL,
computeSomething( ) )


where computeSomething( ) can be a public user defined function, returning
some value, in a standard module, but which can do something else too, as
side effect, such as sending you an email. I assumed that in the negative,
the result to return is NULL.



Vanderghast, Access MVP


"Golfinray" wrote in message
...
Is there a way in a query to have let's say three fields and do this:
If this field is not null OR if this field is not null OR if this field is
not null then do something? Is that possible? Thanks so much!!!!




  #5  
Old July 3rd, 2008, 05:06 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Query Question - I don't know

In the SQL view, have something like:

SELECT *
FROM myTable
WHERE (field1 IS NULL) OR (field2 IS NULL) OR (field3 IS NULL)



Vanderghast, Access MVP



"Golfinray" wrote in message
...
I didn't explain very well, sorry. I have fields of numbers and I would
like
to return records only if any one or all of the 3 fields is null. So if
any
or all of the 3 fields in that record is null, I want to return that with
the
query. That information will go on a report. Then I know that one or more
of
them are missing. Thanks again!!!

"Michel Walsh" wrote:

Yes, if you know what to do in the negative. Note that I assume by "do
something" you mean compute something:



iif( (field1 IS NULL) AND (field2 IS NULL) AND (field3 IS NULL),
NULL,
computeSomething( ) )


where computeSomething( ) can be a public user defined function,
returning
some value, in a standard module, but which can do something else too, as
side effect, such as sending you an email. I assumed that in the
negative,
the result to return is NULL.



Vanderghast, Access MVP


"Golfinray" wrote in message
...
Is there a way in a query to have let's say three fields and do this:
If this field is not null OR if this field is not null OR if this field
is
not null then do something? Is that possible? Thanks so much!!!!






 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.