Query with multiple conditions "greater than" (1 Viewer)

ilcaa72

Registered User.
Local time
Today, 17:35
Joined
Nov 27, 2016
Messages
38
I have 4 fields of the same metric covering last 4 years. I want to find Stocks where there is a decline in every year. I currently have this query
Code:
SELECT Ideas_Risks.Country, Ideas_Risks.Symbol
FROM Ideas_Risks
WHERE (([Ideas_Risks]![CFROI_FY-3]>[Ideas_Risks]![CFROI_FY-2]>[Ideas_Risks]![CFROI_FY-1]>[Ideas_Risks]![CFROI_LFY]));
In Expression Builder
Code:
[Profit_2013] [B]>[/B] [Profit_2014] [B]>[/B] [Profit_2015] [B]>[/B] [Profit_2016]

it returns 98 symbols out of 310, but if i do this in Excel
Code:
=AND(G2<F2,I2<H2,K2<J2)
it returns 47 which is correct (columns not in order).

So i assume i wrote the query incorrectly. Any assistance with this SQL query
 

plog

Banishment Pending
Local time
Today, 16:35
Joined
May 11, 2011
Messages
11,680
Those cannot be equivalent statements. In the Access code you are referencing 4 columns and in the Excel code you are referencing 6.

Also, I would use the AND operator in Access as well:

WHERE A>B AND B>C AND C>D
 

ilcaa72

Registered User.
Local time
Today, 17:35
Joined
Nov 27, 2016
Messages
38
thats a good point, i didn't notice, it matches now, thanks for the help
 

Users who are viewing this thread

Top Bottom