473,468 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Query to ignore other conditions

Hi

I have a query that has 4 different fields, with numbers in them..I
want it to pull out all records which have the number 1 in ATLEAST one
of the four selected fields.

Please advise

Cheers
Sunny

Nov 29 '05 #1
6 1177

WHERE ((Field1 Is Not Null) OR (Field2 Is Not Null) OR (Field3 Is Not Null)
OR (Field4 Is Not Null))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<su**********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...

I have a query that has 4 different fields, with numbers in them..I
want it to pull out all records which have the number 1 in ATLEAST one
of the four selected fields.

Please advise

Cheers
Sunny

Nov 29 '05 #2
Thanks Allen, I am looking for it to pull out a specific series of
numbers like 522,523,597,600 . If any of these 4 numbers are present
in any of the 4 columns, I want all these records to be displayed.

Nov 29 '05 #3
WHERE (Field1 IN (522, 523, 597, 600)
OR Field2 IN (522, 523, 597, 600)
OR Field3 IN (522, 523, 597, 600)
OR Field4 IN (522, 523, 597, 600))

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<su**********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Thanks Allen, I am looking for it to pull out a specific series of
numbers like 522,523,597,600 . If any of these 4 numbers are present
in any of the 4 columns, I want all these records to be displayed.

Nov 29 '05 #4
Thanks Allen, sorry but could you please provide the complete code? the
SELECT XX from XX ?
I am no good at this, but I need to get this working..

Cheers

Nov 29 '05 #5
1. Create a query that selects the fields you want from the table(s) you
want.

2. type anything into the Criteria row under one of the fields.

3. Switch the query to SQL View (View menu).

4. Replace the line containing:
WHERE ...
with the WHERE clause from the previous post.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<su**********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Thanks Allen, sorry but could you please provide the complete code? the
SELECT XX from XX ?
I am no good at this, but I need to get this working..

Nov 29 '05 #6
That helps, thanks Allen

Nov 29 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ben | last post by:
I have been using a nasty combination of php and mysql to generate a narrow down by attribute bar as seen on the likes of shopping.com. For example a user could select 4X Zoom to narrow down a...
9
by: hemal | last post by:
I came across a very strange situation at work. There is an order of magnitude difference in execution time for the following two queries (10 v/s ~130 msec): select count(*) from table_name...
1
by: Ryan Govostes | last post by:
Eh, I was wondering if anyone could help me with a SQL query problem I'm having. I'm a complete newbie to SQL and MySQL, so any help would be greatly appreciated. I am using PHP to allow users...
6
by: Umar Farooq | last post by:
Hello all, Please bear with the long explanation of my scenario. As I'm relatively new to the query world, I like to write my queries using the visual toos such as the "View" option in SQL...
2
by: ruben | last post by:
Hi: I must have missed something, but how is it possible that a join on tables A and B is faster (a lot faster) than a query to one of the tables with the same conditions? The problem seems...
6
by: Brian | last post by:
Hello, Basically, I'm running a query on a form's activation, and I'd like to have the results of the query be placed into other fields on the same form automatically. Does anybody know how...
2
by: ecoulson123 | last post by:
I am using Access 2000. I am trying to summarize numeric data from a large database. The problem is that I need the summarization functions to ignore "junk" data, defined in a couple ways. ...
3
by: jason.teen | last post by:
Hi, I have a table such as below and I want to write a query which says "For each product, Exclude all Rows where Rate is 0 and Code is not D, but if any of the rows for that product is found...
5
by: Samik2003 | last post by:
Hello, The problem is my query is not extracting the correct xml data from the database : Is there something which I am missing?? ANy help would be appriciated. Thanks, Sam. THis is the...
2
by: Coll | last post by:
I have a form and a query. I would like to have some control on the form (check box probably), that when selected will limit the criteria for a field in a query. Here are the details.... When...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.