Checking For Specific Value

  • Thread starter Thread starter Alan B. Densky
  • Start date Start date
A

Alan B. Densky

I'm using Access 2000 with DAO.

I have a query that contains approx 50 fields for each record. I would like
to be able to check every field in the query for a value of "T"

If any field for the selected record has a value = "T" then the value of the
query is true. Otherwize it is false.

How can I loop through every field looking for the "T"?

Thanks in advance,
Alan
 
You will need to generate the SQL statement that examines each field, e.g.:

SELECT * FROM Table1
WHERE 'T' IN ([Field1], Field2], [Field3], ... );

Almost certainly, these fields should be *records* in a related table, so
that the main record can have as many of these as apply (up to 50 related
records for each record in the main table.) With this correctly normalized
design, there would be only one fields to search.
 
Thank you!

Alan

Allen Browne said:
You will need to generate the SQL statement that examines each field, e.g.:

SELECT * FROM Table1
WHERE 'T' IN ([Field1], Field2], [Field3], ... );

Almost certainly, these fields should be *records* in a related table, so
that the main record can have as many of these as apply (up to 50 related
records for each record in the main table.) With this correctly normalized
design, there would be only one fields to search.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Alan B. Densky said:
I'm using Access 2000 with DAO.

I have a query that contains approx 50 fields for each record. I would
like
to be able to check every field in the query for a value of "T"

If any field for the selected record has a value = "T" then the value of
the
query is true. Otherwize it is false.

How can I loop through every field looking for the "T"?

Thanks in advance,
Alan
 

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