Same query in multiple fields

Brewsi

New member
Local time
Today, 02:43
Joined
Mar 2, 2016
Messages
9
Hi there,
This seems like it should be a simple question bit for the life of me can't figure it out.

I have multiple fields in a table.
I want to run a query that says

If any field reads "no" then show record in query,

I am not proficient in SQL bit am using the query tool. I have put "no" in all of the Or criteria but it brings me back no data

Can anyone help please

Thank you in advance
 
on query design, add another calculated field:

Instr("" & [field1] & [field2] & [field3] & [fieldNth], "no")
Criteria: > 0
 
In design view, you would stagger your criteiria. That means for the first field you would put 'No' on the first criteria line, for the second field you would put 'No' on the second criteria line, third field--third criteria line, etc.
 
Hi there

Thanks for your replies

I have staggered the Or option like you said but I have run out of lines. Is there any way to increase the amount of ORs?
 
You could go into the SQL and repeat the patter in the WHERE clause. However, arnelgp's advice might be better.
 
If you have that many items, I wonder if your problem is an original design issue. That question and your responses to the replies make me wonder if you are looking at a case of a "repeating field" where you should really have a parent/child relationship. The individual yes/no answers would be recorded in child records associated with of the parent record. Then you could use a

Code:
DCount("[Answ]","childtable","([Answ]=False) AND ([QuestionID]=" & cstr(Qnumber) & ")" )
 
I think you made be right in as much as the design of the db is incorrect. I am quite new to this and still making mistakes

arnglgp does that code allow for unlimited fields?
DOCMAN do you know of any good material to guide through db structure. As I have a lot of data to capture under one record.
 
sir, you have to try it with whatever field you have with "no" value.
 

Users who are viewing this thread

Back
Top Bottom