date and price queries
I am working with a farm that has a table of crops with fields for crop name, crop price and modified date. I am trying to figure out an efficient means of date checking in the query process so I only obtain the one row with price for that particular date period. For example to create a current crop list I would create a query that only selects the row for most recent mod date. If the crop table has 9 rows and there are three rows for carrots, 4 for beets and 2 for turnips, I want to only select one carrot record, one beet and one turnip that would then give me the current price from that record. An archive table won't work since prices fluctuate at irregular intervals and reports need to be created monthly, quarterly and annually that reflect the prices that the crops sold for at that time, not current prices.
Any assistance would be most appreciated.
|