Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if date in date range sum number

Status
Not open for further replies.

ajdesigns

Technical User
Jan 26, 2001
154
GB
I have 2 tables
sales and orders.
The sales table has weekly sales amounts ie week commencing 01/01/2005 to week ending 06/01/2005 this then shows a total sales for that week.
However the orders table shows orders as the occur ie daily.
how can Idisplay the orders that fall into the w/c to w/e bucket of the sales table.
If the sales dates were from w/c 01/01/2005 to w/e 06/01/2005, I want to show all the orders that came in for that product for that period .so I can do a comparison.
The tables are linked on product no.

This a sample of the data in the sales table
Product WC WE Sales
A2283J01 05-Dec-04 11-Dec-04 5101
A2283J01 12-Dec-04 18-Dec-04 4113
A2283J01 19-Dec-04 25-Dec-04 2106
A2283J01 26-Dec-04 01-Jan-05 574
A2283J01 02-Jan-05 08-Jan-05 2814


product description date_entered order_qty
A2283J01 MULX GP 25 UK/SPAN 08-Nov-04 3816
A2283J01 MULX GP 25 UK/SPAN 16-Nov-04 7200
A2283J01 MULX GP 25 UK/SPAN 19-Nov-04 864
A2283J01 MULX GP 25 UK/SPAN 25-Nov-04 2808
A2283J01 MULX GP 25 UK/SPAN 25-Nov-04 3728
A2283J01 MULX GP 25 UK/SPAN 26-Nov-04 3744
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3528
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3528
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3528
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3600
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3600
A2283J01 MULX GP 25 UK/SPAN 06-Dec-04 3600

thanks
AJD
 
In the report record selection,
Code:
order.date >= sales.startdate 
and 
order.date<= sales.enddate

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top