query to set up report

R

RobUCSD

I have a table that has 20 fields that are y/n fields. Only some of the
fields are checked in each record. I want to know is there a way to query
this table so that it gives me a new record set that onlyincludes the fields
that are checked as individual records in a new table.

Ex: fld1(false) fld2(True), fld3(True), fld4(False) I would like to output
only the two fields that have been checked flds2 and 4

The new recordset would look like this tblResults with one field
called fldResults, the table would have two records in it, fld2 and fld3.

I know that better normalization of the tables is the true answer, and I
plan on re-designing the tables and forms in the future. But in the mean
time, is it possible to do this. If so, any suggestions would be very much
appreciated.

Thanks Rob
 
S

Shiller

I have a table that has 20 fields that are y/n fields. Only some of the
fields are checked in each record. I want to know is there a way to query
this table so that it gives me a new record set that onlyincludes the fields
that are checked as individual records in a new table.

Ex: fld1(false) fld2(True), fld3(True), fld4(False) I would like to output
only the two fields that have been checked flds2 and 4

The new recordset would look like this tblResults with one field
called fldResults, the table would have two records in it, fld2 and fld3.

I know that better normalization of the tables is the true answer, and I
plan on re-designing the tables and forms in the future. But in the mean
time, is it possible to do this. If so, any suggestions would be very much
appreciated.

Thanks Rob

Rob,

You can create a query in design view and set the criteria to "True",
that way only the fields that have been checked will be in the output.

the syntax in SQL view would be something like:

SELECT fld1, fld2, fld3, fld4
FROM tblExample
WHERE (((fld1)=True) AND ((fld2)=True) AND ((fld3)=True) AND
((fld4)=True));

You can save the result in your new table tblResuts.
 

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