By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,497 Members | 2,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,497 IT Pros & Developers. It's quick & easy.

How to make Criteria in a Yes/No Field

P: 2
sori didn't read first the guidelines. i am using Access 2003.
Farmers - text data type
Planting Information - Yes/No data type
Harvesting Information - Yes/No data type
In the query, how can i make a criteria on a yes/no data type?so that the outcome will be the farmers name and only those which has a check mark signifying that they want this kind of brochure.it can not include the other field names which doesn't have a check mark.


note: planting information and harvesting are brochures to be given to the farmer if they want information regarding for example planting or harvesting procedure.
thanks

julie
Feb 24 '07 #1
Share this Question
Share on Google+
3 Replies


vijaydiwakar
100+
P: 579
sori didn't read first the guidelines. i am using Access 2003.
Farmers - text data type
Planting Information - Yes/No data type
Harvesting Information - Yes/No data type
In the query, how can i make a criteria on a yes/no data type?so that the outcome will be the farmers name and only those which has a check mark signifying that they want this kind of brochure.it can not include the other field names which doesn't have a check mark.


note: planting information and harvesting are brochures to be given to the farmer if they want information regarding for example planting or harvesting procedure.
thanks

julie
julie, u have to use true or false keyword as
select * from table where <fieldname>=true
Feb 24 '07 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Julie is this what you are looking for ...

Expand|Select|Wrap|Line Numbers
  1. SELECT Farmers
  2. FROM TableName
  3. WHERE [Planting Information] = True;
Expand|Select|Wrap|Line Numbers
  1. SELECT Farmers
  2. FROM TableName
  3. WHERE [Harvesting Information] = True;
Feb 24 '07 #3

NeoPa
Expert Mod 15k+
P: 31,186
I hate to be contradictory (I love it really :D), but you should very rarely, if ever, compare a boolean result with either TRUE or FALSE. The most reliable (and recommended) way to check boolean values is simply by using them as booleans.
Expand|Select|Wrap|Line Numbers
  1. SELECT Farmers
  2. FROM TableName
  3. WHERE [Planting Information];
Expand|Select|Wrap|Line Numbers
  1. SELECT Farmers
  2. FROM TableName
  3. WHERE [Harvesting Information];
Anyone ever tells you different - send them to me :D
Feb 26 '07 #4

Post your reply

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