First, I want to thank all the people who have helped me in the past.
I have a bit of a dilemma for this current query.
Okay, As an Example, I have a Company Code, a Variable, a Date Range and a Value.
I know how to do the Date Range to pull between any two dates. (in this case, years). What I am trying to do, though, is pull only those Company's that have a Value for all years in the date range.
SELECT DISTINCT Data.COMPANY
FROM Data
WHERE (((Data.VARIABLE)=[Enter Variable]) AND ((Data.YEAR) Between [Enter Start Year] And [Enter End Year]) AND ((Data.VALUE)<>"" And (Data.VALUE)<>"0"));
But this isn't pulling just those that have value for all years. (So if I do a date range of 2000 to 2010 it will pull all the Company's that have a value in any of those years. But I want only Company's that have a value in all of those years.)
Number of years and the dates can change.
Any ideas?
Much obliged. And Happy New Year.
I have a bit of a dilemma for this current query.
Okay, As an Example, I have a Company Code, a Variable, a Date Range and a Value.
I know how to do the Date Range to pull between any two dates. (in this case, years). What I am trying to do, though, is pull only those Company's that have a Value for all years in the date range.
SELECT DISTINCT Data.COMPANY
FROM Data
WHERE (((Data.VARIABLE)=[Enter Variable]) AND ((Data.YEAR) Between [Enter Start Year] And [Enter End Year]) AND ((Data.VALUE)<>"" And (Data.VALUE)<>"0"));
But this isn't pulling just those that have value for all years. (So if I do a date range of 2000 to 2010 it will pull all the Company's that have a value in any of those years. But I want only Company's that have a value in all of those years.)
Number of years and the dates can change.
Any ideas?
Much obliged. And Happy New Year.