473,394 Members | 1,722 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,394 software developers and data experts.

'Where' referring to any field

Hi,

I have a table in which all filelds are 'Yes/No'. I want to select all
records with an occurence of 'Yes' in any one of those fields. Rather than
a long winded if and or statement, which would have to be modified if I
added fileds later, is there a simple way of saying include the record if
any field is 'Yes'?

JohnM
Nov 13 '05 #1
3 1090
Put True on a different line for each field in the query.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:cn*******************@news.demon.co.uk...
Hi,

I have a table in which all filelds are 'Yes/No'. I want to select all
records with an occurence of 'Yes' in any one of those fields. Rather than a long winded if and or statement, which would have to be modified if I
added fileds later, is there a simple way of saying include the record if
any field is 'Yes'?

JohnM

Nov 13 '05 #2
"John M" <jo**@jmawer.demon.co.uk> wrote in message
news:cn*******************@news.demon.co.uk...
Hi,

I have a table in which all filelds are 'Yes/No'. I want to select all
records with an occurence of 'Yes' in any one of those fields. Rather
than
a long winded if and or statement, which would have to be modified if I
added fileds later, is there a simple way of saying include the record if
any field is 'Yes'?

Depending in how many of these columns you have, you could use a single
bitmasked column of data type Int (Long) to represent all the yes / no
options. There's a very good description of how this works at
http://www.mvps.org/access/general/gen0038.htm

Then you can just test for the case when the value > 0
Nov 13 '05 #3
Sum the values of all the Yes/No fields in a query. If all of the
fields are False, the sum will be Zero. If any of them are true, the
sum will be non-zero.

On Sun, 14 Nov 2004 18:31:01 -0000, "John M" <jo**@jmawer.demon.co.uk>
wrote:
Hi,

I have a table in which all filelds are 'Yes/No'. I want to select all
records with an occurence of 'Yes' in any one of those fields. Rather than
a long winded if and or statement, which would have to be modified if I
added fileds later, is there a simple way of saying include the record if
any field is 'Yes'?

JohnM

**********************
ja**************@telusTELUS.net
remove uppercase letters for true email
http://www.geocities.com/jacksonmacd/ for info on MS Access security
Nov 13 '05 #4

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

Similar topics

1
by: anmar | last post by:
I'm trying to figure out how to select all the records in one table which have multiple specified records in a second table. Here's a simplified version of my problem. I have two tables,...
3
by: tsteinke | last post by:
What is the syntax to refer to your current row in an SQL statement? I am using the "Lookup Wizard" to build a query in a table. How do you refer to the Current Row For instance I have a Table...
4
by: MLH | last post by:
Somehow, I seem to be able to refer to combo-box controls in 2 distinctly different ways. A combo-box on an Access 97 form named TagCountyChooserBox seems can be referenced these ways... ...
60
by: Dave | last post by:
I'm never quite sure whether to use "this." or not when referring to fields or properties in the same class. It obviously works just fine without it but sometimes I wonder if using this....
2
by: ey.markov | last post by:
Greetings, in A2K VBA, I set the following recordset: Set rsGPValue = dbs.OpenRecordset("SELECT *, DateSerial(Year(),Month()+4,0) FROM tblGPValue AS OurDate, dbOpenSnapshot) and then I try...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
15
by: esha | last post by:
I need to have a Public variable in my project. In VB it can be declared in a standard module. Where can I do it in C# ? I tried to do it in default class Program.cs and I tried it in an added by...
1
by: michal2 | last post by:
Is there any way to have the referring field blank when using the GetURL command?
3
markmcgookin
by: markmcgookin | last post by:
Hi Folks, I have a VB app, and I have been working at it for a while, and I am now at the stage where I want to create a search function. Now don't be scared! It is in the .Net compact framework,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.