Assigning 1/0 to yes/no

  • Thread starter Thread starter Guest
  • Start date Start date
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0 for False.
Abs(YourBooleanField) would yield either1 or 0.
 
If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100
 
Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.

David F Cox said:
If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100

Al Campagna said:
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0
for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
the Yes/No type is (minus) -1 and 0
If you want to use a ComboBox, you can set the field as numeric and not
Yes/No and Row Source Type as Value list, Columns = 2, Bound column = 1,
Column Width = 0;5 and the Row Source = 0;"No";1;"Yes"
 
A combo box is really not the right type of control to use for this purpose.
I would suggest an Option group with two toggle buttons. Make the caption of
one button Yes and its Option Value -1. Make the other No and 0

The option group control will return the value of the selected button.
You could make True = 1, but since the Boolean data type exists soley for
binary situations, why not use it?

colesterg said:
Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.

David F Cox said:
If you tell us why you are more likely to learn something.

If you are trying to add up "Yes" answers
-sum([my_yn])


% of yes answers:
- avg(my_yn)*100

Al Campagna said:
Cole,
Not sure why that would be necessary but...
Normally a Boolean True/False or Yes/No field yields a -1 for True and 0
for False.
Abs(YourBooleanField) would yield either1 or 0.
--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

Is there a way to assign a value of 1/0 for yes/no, respectively?
 
Well, I want the combo box to say yes/no so I wont confuse anyone, but I want
it to store this data numerically, not as a yes/no.

Use a two-column combo box, with the visible column containing "Yes"
and "No", and the bound column containing 1 and 0.

John W. Vinson[MVP]
 
It worked! Thank you!

John Vinson said:
Use a two-column combo box, with the visible column containing "Yes"
and "No", and the bound column containing 1 and 0.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top