ACCESS 2007-Parameter Query selecting previous records

  • Thread starter Thread starter ut4me
  • Start date Start date
U

ut4me

I have one table – “DAILY INFORMATIONâ€
This Table contains sales information for each day. The fields involved in
this issue are listed below
SALE DATE - primary key
REGISTER 1 NET
REGISTER 2 NET
REGISTER 3 NET

Problem Description – I have a parameter query that takes the “SALE DATEâ€
information from the user and then returns the data from the fields listed
above. I need for this parameter query to also return the same information
from the previous 6 records based on whatever value the user submits as the
“SALE DATEâ€
Any help is much appreciated…
bart
 
You have your database set up like a spreadsheet instead of a relational data.
It should be like this --
SaleID - primary key
SALE_DATE - datetime
REGISTER - number - long integer
NET - number - single

But to use your data you need this --
SELECT [SALE DATE], [REGISTER 1 NET], [REGISTER 2 NET], [REGISTER 3 NET]
FROM YourTable
WHERE [SALE DATE] Between CVDate([Enter sales date]) AND CVDATE([Enter
sales date]) -5;
 
Back
Top