"deltauser2006" <sd**@georgetown.edu> wrote in
news:11**********************@v46g2000cwv.googlegr oups.com:
Here's the thing though, the data is constantly changing so
basically I'm looking for snapshots through time of the
database. I'll explain further.
The data is for apartment rents and other information. So we are constantly surveying
and getting new rents (we do that every quarter).
Every quarter all the data has changed slightly. When we do
analysis we want to be able to look back at all the data from,
lets say a year ago. I would need to make a printout that
had, for example: Current Average Rent vs. Average Rent During
This Quarter Last Year. What I am trying to do is automate
this process. I want the report to recognize that it is
currently the 1st quarter, that it should use the data
currently in the database for that number and that it should
pull last years comparison from the 1st quarter '05 data
(Which obviously would take 1 year of data being stored before
it would function seamlessly). Any tips on attacking that? I
really appreciate any help I can get. Thanks
your data from '05 has to be in the same table as for '06 for
this to work effectively. If you have a date of effectivity for
the data, it becomes easy to do this sort of thing.
The way I would build it is that you have a parent record for an
apartment, and a related set of child records that contains the
stuff that changes for that apartment, the date, the amount of
rent, whether it is rented or vacant, that sort of thing. Every
time (quarter) you get new information, a new record is added to
the child table.
When the time comes for statistical analysis, you use the date
of the child record to filter into quarters.
QuarterOfYear: (Month(Effectivitydate)\3)+1
to compare this year's data to last, create a query that
groups on apartmentType, quarterofyear (as defined above) and
year of effectivitydate
Compare this year to 3 years ago? the query doesn't change, only
the filter parameters, (year = 2006 or year = 2003) instead of
2006 or 2005. The filter for QuarterOfYear would be constant at
1
Want to compare last quarter's data instead, reorder year and
quarter. then filter on (Year =2005 and QuarterofYear = 4) or
(Year = 2006 and QuarterofYear = 1)
If you insist on seperate tables for every year, you'll curse
yourself sooner than later.
--
Bob Quintal
PA is y I've altered my email address.