Few Questions - changed

NavyJoe

Board Regular
Joined
Sep 14, 2004
Messages
63
1. I'm working on a database for awards. I have a table with a yes/no field. What I want is another field in the table to equal -1 if the yes/no field is yes. If it doesn't, then it's 0. This data will be linked to another table where a running inventory is kept. Thanks.

I've tried sum([yes/no field]), but it gives me the total sum of the database...grrrr...
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Two things:

1. First, it is unnecessary. In Access Yes/No fields already have these values (Yes=-1 and No=0). To see this, simply create a calulcated field in your query where you take this field and add 0 to it (to coerce it to be displayed as a number).

2. Second, you would never want to add such a field to a table, as it violates the laws or Database Normalization, specifically that fields in a table should NOT be dependent upon other non-key fields in that table. Doing so removes the dynamic nature of the database (i.e. if you changed the value of one of these fields, the dependent value would not be updated automatically).

Any value which can be derived from other values in a table should be calculated in a query, where they will become dynamic, not stored in the table.
 
Upvote 0

Forum statistics

Threads
1,203,124
Messages
6,053,643
Members
444,675
Latest member
FedElecQaEng

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top