Using Access 2000
Here is the SQL for a Union Query that combines data from other queries for 4 separate years.
I want to be able to calculate the percent change from 2001 to 2004. Is there a way to add an additional field in this union query to do that? Or, alternatively, is there another way to accomplish it?
I can't do it in a Select query, because there are cases where an individual LastName has a SumOfLocal entry in 2004 but not in 2001, and vice versa, so the join doesn't pull all the records.
Thanks.
Tom
Here is the SQL for a Union Query that combines data from other queries for 4 separate years.
Code:
SELECT LastName, EnvNbr, SumOfLocal,"2004" AS Year
FROM qry900s2004Local
UNION SELECT LastName,[Env #], SumOfLocal,"2001"
FROM qry900s2001Local
UNION SELECT LastName, [Env #], SumOfLocal, "2002"
FROM qry900s2002Local
UNION SELECT LastName, [Env #], SumOfLocal, "2003"
FROM qry900s2003Local
ORDER BY EnvNbr, Year;
I want to be able to calculate the percent change from 2001 to 2004. Is there a way to add an additional field in this union query to do that? Or, alternatively, is there another way to accomplish it?
I can't do it in a Select query, because there are cases where an individual LastName has a SumOfLocal entry in 2004 but not in 2001, and vice versa, so the join doesn't pull all the records.
Thanks.
Tom