I have a -1 and a 0 for values

T

T Miller

I want to change them from the -1 to equal YES and the 0 to equal NO. Does
this need to be done from the table? If so, where do you make this happen?
OR, Does it need to be done in the make table query? If so, how?
 
K

Klatuu

Use a Calculated Field in your query to transform the values:

YN: iif([YesNoField] = 0, "No","Yes")
 
F

fredg

I want to change them from the -1 to equal YES and the 0 to equal NO. Does
this need to be done from the table? If so, where do you make this happen?
OR, Does it need to be done in the make table query? If so, how?

No, your table should store -1 or 0.

Wherever you need to display the value as "Yes" or "No", set the
Format property of that control to:
;"Yes","No";
 
J

John W. Vinson

I want to change them from the -1 to equal YES and the 0 to equal NO. Does
this need to be done from the table? If so, where do you make this happen?
OR, Does it need to be done in the make table query? If so, how?

It should not be done in EITHER place. Tables are for data storage, not for
data presentation!

Yes *is* stored as -1, and No as 0. True and False are also synonyms, but the
actual storage is as a number. You don't need to care about that, though; if
you're going to display the value, you can use a Form (for onscreen use) or
Report (for printing), and set the format of the textbox bound to this field
appropriately.

John W. Vinson [MVP]
 
M

mdg381

I have the same values, but I want a +1 for yes, and 0 for no. Since I want
these exported to Excel in the interim and eventually to figure out how to
make a chart in Access, I need the values reported as positive numbers for
calculations. Is that possible?

Also, for Yes, sometimes I want the value to be 6, or 7, or, 8 or whatever.
Yes having been assigned a weighted value for that particular input. Can I
do that? It need to be a positive value. How do I do that?
 
R

Roger Carlson

There are several things you can do.

First of all, you can create your field as an integer or byte field, storing
1 or 0. On your data entry forms, you could represent this with a combo box
that displays Yes and No, but actually stores 1s and 0s. You could also
display it with an option group with two radio buttons, again displaying Yes
and No, but storing 1s and 0s.

Another option is to create the field as a boolean (Yes/No) field, which
will store the Yes's as -1. Then, anytime you do any math (like summing)
you can use the ABS() function to return the Absolute Value (which will be
positive).

As for the weighting, I would store the weight in a separate field, which
you can multiply with your "yes" values, to produce your weighted values.


--
--Roger Carlson
MS Access MVP
www.rogersaccesslibrary.com
http://rogersaccessblog.blogspot.com/
 

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

Top