If this or that??

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I need to make a query that says if any of the following fields have a value
list them. Below is the sql without the filter.

I need to know if any of the following feilds (check boxes) are checked ,
show the record in the query

[Registro Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti,
[Registro Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora,

thank you
Michael



SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
ORDER BY [Registro Entrate].Del;
 
This will show records where any one of the fields is true (checked). Is this
what you want?

SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
WHERE [Registro Entrate].Marciume = True
or [Registro Entrate].PresenzaDiErbeInfestanti = True
or [Registro Entrate].AnomalieSulleFoglie = True
or [Registro Entrate].Peronospora = True
ORDER BY [Registro Entrate].Del;
 
Yes thank you very much.. I totally forgot about and how to use "or" thanks
for taking the time to work this out for me.
Michael

John Spencer said:
This will show records where any one of the fields is true (checked). Is
this
what you want?

SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
WHERE [Registro Entrate].Marciume = True
or [Registro Entrate].PresenzaDiErbeInfestanti = True
or [Registro Entrate].AnomalieSulleFoglie = True
or [Registro Entrate].Peronospora = True
ORDER BY [Registro Entrate].Del;
I need to make a query that says if any of the following fields have a
value
list them. Below is the sql without the filter.

I need to know if any of the following feilds (check boxes) are checked ,
show the record in the query

[Registro Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti,
[Registro Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora,

thank you
Michael

SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
ORDER BY [Registro Entrate].Del;
 
Glad to help. Also, you helped yourself by posting the SQL statement that could
be used as a basis. Many posters don't and that makes defining a solution difficult.
Yes thank you very much.. I totally forgot about and how to use "or" thanks
for taking the time to work this out for me.
Michael

John Spencer said:
This will show records where any one of the fields is true (checked). Is
this
what you want?

SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
WHERE [Registro Entrate].Marciume = True
or [Registro Entrate].PresenzaDiErbeInfestanti = True
or [Registro Entrate].AnomalieSulleFoglie = True
or [Registro Entrate].Peronospora = True
ORDER BY [Registro Entrate].Del;
I need to make a query that says if any of the following fields have a
value
list them. Below is the sql without the filter.

I need to know if any of the following feilds (check boxes) are checked ,
show the record in the query

[Registro Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti,
[Registro Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora,

thank you
Michael

SELECT [Registro Entrate].Fornitore, [Registro Entrate].Del, [Registro
Entrate].Prodotto, [Registro Entrate].RintracciabilitàLotto, [Registro
Entrate].Marciume, [Registro Entrate].PresenzaDiErbeInfestanti, [Registro
Entrate].AnomalieSulleFoglie, [Registro Entrate].Peronospora, [Registro
Entrate].AnomalieSulleFogliesesiquali
FROM [Registro Entrate]
ORDER BY [Registro Entrate].Del;
 

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