473,387 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access Query Question

16
I have six check box type fields. I would like to have a field in my query that says the following:

If one of the six fields are true then show me the data for that record

but if all the boxes are false then do not show me the data for that record

I am only interested in data that has at least one of the check boxes checked.
Mar 28 '14 #1
2 974
Seth Schrock
2,965 Expert 2GB
It sounds like you just need a WHERE clause in your query. So lets say your six fields are

Field1
Field2
Field3
Field4
Field5
Field6

Then you would just put the following in the WHERE clause
Expand|Select|Wrap|Line Numbers
  1. WHERE (Field1 = True OR Field2 = True OR
  2. Field3 = True OR Field4 = True OR
  3. Field5 = True OR Field6 = True)
This doesn't add a field to your query, but it does limit which records are returned.
Mar 28 '14 #2
NeoPa
32,556 Expert Mod 16PB
A simpler alternative would be :
Expand|Select|Wrap|Line Numbers
  1. WHERE ([chk1] OR [chk2] OR [chk3] OR [chk4] OR [chk5] OR [chk6])
It's never a good idea to compare a boolean value to True or False. It has a tendency to confuse the reader and the writer. It never helps understanding to do so, and can even cause unexpected results when it's run.
Mar 31 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jack | last post by:
Hi, I have a stored access query which is corresponding to a particular id. However, I am using a login script to capture the value of an id. Now, I want to dynamically open the stored query by...
1
by: Jaycee66 | last post by:
Access 2000 "Between" query question: I am relatively new to MS Access and everytime I think I have a basic concept of the program it pokes me in the eye with something I think would be simple to...
5
by: Art | last post by:
Hi, Can anyone point me to an example of how I would execute a query I've created in an Access DB. I've copied the SQL down to my VB.net application and that works fine, but it's ugly. I'd like...
2
by: Dave Harrington | last post by:
Hi all - I got a pretty basic question that's been bugging me today. I'm using ASP.NET, C# and MS Access for a database driven application. I have a datagrid that will populate based on a...
0
by: Sheldon | last post by:
I have a query (query1) that contains a number of result fields. One of those fields (field1), can contain any or all of the following values: 1, 2, 3, 4, 5, 6, 7 or 8. I also have a field...
2
by: lairds | last post by:
I've built a query that tells me clients, dates they had sessions and if they are Amish or English. I need to know during a certain time period how many of these clients were Amish, etc. My...
12
by: zwasdl | last post by:
Hi, I'm using MS Access to query against Oracle DB via ODBC. Is it possible to use HINT in Access? Thanks, Wei
13
by: john | last post by:
I have table User-App and table App Profile User-App App Profile IDuser IDApp IDApp 1 34 34 1 45 45 2 34 2 45 2 90 3 34
6
by: jsacrey | last post by:
Hey everybody, got a secnario for ya that I need a bit of help with. Access 97 using linked tables from an SQL Server 2000 machine. I've created a simple query using two tables joined by one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.