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...
 

Some videos you may like

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
55,381
Office Version
  1. 365
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,084
Messages
5,570,129
Members
412,305
Latest member
Mozz
Top