Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2008

Tip: Looking for answers? Try searching our database.

Query Question - I don't know

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Golfinray - 03 Jul 2008 14:22 GMT
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!!!!
Bob Barrows [MVP] - 03 Jul 2008 14:54 GMT
> 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.

Signature

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"

Michel Walsh - 03 Jul 2008 14:54 GMT
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

> 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!!!!
Golfinray - 03 Jul 2008 15:12 GMT
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!!!

> Yes, if you know what to do in the negative. Note that I assume by "do
> something" you mean compute something:
[quoted text clipped - 12 lines]
> > 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!!!!
Michel Walsh - 03 Jul 2008 17:06 GMT
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

>I didn't explain very well, sorry. I have fields of numbers and I would
>like
[quoted text clipped - 26 lines]
>> > is
>> > not null then do something? Is that possible? Thanks so much!!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.