query option

G

Guest

i want to put 3 records in the same line of my query
i explain better..
i dot a table with date, product code, quantity order.
i would like to get this result in my query
date (today's date),Quantity (Yesterday Quantity), quantity (Today
Quantity), quantity ( Tomorrow quantity).


thank u
 
J

John Vinson

i want to put 3 records in the same line of my query
i explain better..
i dot a table with date, product code, quantity order.
i would like to get this result in my query
date (today's date),Quantity (Yesterday Quantity), quantity (Today
Quantity), quantity ( Tomorrow quantity).

A "Self Join" query will do this for you. Create a Query by adding
your table to the query grid *three times*. Join the three instances
by Product Code. Access will alias the second instance of the table as
tablename_1, and the third as tablename_2. You can change these
aliases to Yesterday and Tomorrow if you wish.

Select the Product Code from the first instance, and the quantity and
date fields from all three.

Put a criterion on tablename.[date] of

=Date()

On tablename_1.date put

=Date() - 1

and on tablename_2.date

=Date() + 1


John W. Vinson[MVP]
 

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