K
KAitchison
I have a question which probally has a simple answer but I am a bit stuck on
it..
I have a table which stores quite a bit of data over a long period of time..
I'm trying to write a query that will find records from today's date where
some fields have values above a set number.... right now its returning all
possible dates with fields with values above the set number....
So I want:
Date = Date()
AND 1 or more of the following conditions
%RustFungus >20 OR
%InsectInfestation >20 OR
%LeafCurling>20 OR... and so on
This is my SQL statement:
SELECT TM_Inspection_Data.Date, TM_Inspection_Data.[Tree Row],
TM_Inspection_Data.[% trees Green], TM_Inspection_Data.[% trees Yellow],
TM_Inspection_Data.[% trees Brown], TM_Inspection_Data.[% of trees with
Curling], TM_Inspection_Data.[% treeswith Rust Fungus], TM_Inspection_Data.[%
trees Insect Infestation], TM_Inspection_Data.[% trees Low],
TM_Inspection_Data.[% trees Med], TM_Inspection_Data.[% trees High],
TM_Inspection_Data.[% trees Rodent Impact], TM_Inspection_Data.[% trees
Branches through Gaurd], TM_Inspection_Data.[Comments(Inspection)],
TM_Inspection_Data.[% trees Irrigation System]
FROM TM_Inspection_Data
WHERE (((TM_Inspection_Data.Date)=Date()) AND ((TM_Inspection_Data.[%
treeswith Rust Fungus])>20) OR ((TM_Inspection_Data.[% trees Insect
Infestation])>20) OR ((TM_Inspection_Data.[% trees High])>20) OR
((TM_Inspection_Data.[% trees Rodent Impact])>20));
Can anyone suggest how to fix this to make it do what i want?? Thank you
Krista
it..
I have a table which stores quite a bit of data over a long period of time..
I'm trying to write a query that will find records from today's date where
some fields have values above a set number.... right now its returning all
possible dates with fields with values above the set number....
So I want:
Date = Date()
AND 1 or more of the following conditions
%RustFungus >20 OR
%InsectInfestation >20 OR
%LeafCurling>20 OR... and so on
This is my SQL statement:
SELECT TM_Inspection_Data.Date, TM_Inspection_Data.[Tree Row],
TM_Inspection_Data.[% trees Green], TM_Inspection_Data.[% trees Yellow],
TM_Inspection_Data.[% trees Brown], TM_Inspection_Data.[% of trees with
Curling], TM_Inspection_Data.[% treeswith Rust Fungus], TM_Inspection_Data.[%
trees Insect Infestation], TM_Inspection_Data.[% trees Low],
TM_Inspection_Data.[% trees Med], TM_Inspection_Data.[% trees High],
TM_Inspection_Data.[% trees Rodent Impact], TM_Inspection_Data.[% trees
Branches through Gaurd], TM_Inspection_Data.[Comments(Inspection)],
TM_Inspection_Data.[% trees Irrigation System]
FROM TM_Inspection_Data
WHERE (((TM_Inspection_Data.Date)=Date()) AND ((TM_Inspection_Data.[%
treeswith Rust Fungus])>20) OR ((TM_Inspection_Data.[% trees Insect
Infestation])>20) OR ((TM_Inspection_Data.[% trees High])>20) OR
((TM_Inspection_Data.[% trees Rodent Impact])>20));
Can anyone suggest how to fix this to make it do what i want?? Thank you
Krista