ACCESS 2007-Parameter Query selecting previous records

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
 
K

karl dewey

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top