Have two tables
Sales
-Sold Date
-Salesman
-Amount
Returns
-Return Date
-Salesman
-Refund Amount
Anytime a sale is made - its recorded into the sales table. Likewise anytime a return is made - it's recorded in the return table.
I have a form - that accepts dates- to build a custom query for sales. That way - you can easily design the query to give you all the sales number for a given week, month, year, or open date range. Based on sales date.
I'd like to incorporate into that query the return numbers in two different scopes. Current YTD returns and returns during this period.
So - for example:
Sales
John 1-1-07 500
Mike 1-3-07 500
John 2-8-07 1000
Mark 2-8-07 750
John 2-9-07 200
Returns
John 1-6-07 400
Mike 2-4-07 75
John 2-7-07 100
If the report was ran for the month of february - I'd like a query to give me the following:
Name Sales ReturnsThisPeriod YTDReturns
John 1200 100 500
Mark 750 0 0
Mike 0 75 75
But I'm getting all sorts of lost in how to get all of this in one query - so I can pass it into a report. Any suggestions that you guys could provide - would be fantastic. Thanks!
Sales
-Sold Date
-Salesman
-Amount
Returns
-Return Date
-Salesman
-Refund Amount
Anytime a sale is made - its recorded into the sales table. Likewise anytime a return is made - it's recorded in the return table.
I have a form - that accepts dates- to build a custom query for sales. That way - you can easily design the query to give you all the sales number for a given week, month, year, or open date range. Based on sales date.
I'd like to incorporate into that query the return numbers in two different scopes. Current YTD returns and returns during this period.
So - for example:
Sales
John 1-1-07 500
Mike 1-3-07 500
John 2-8-07 1000
Mark 2-8-07 750
John 2-9-07 200
Returns
John 1-6-07 400
Mike 2-4-07 75
John 2-7-07 100
If the report was ran for the month of february - I'd like a query to give me the following:
Name Sales ReturnsThisPeriod YTDReturns
John 1200 100 500
Mark 750 0 0
Mike 0 75 75
But I'm getting all sorts of lost in how to get all of this in one query - so I can pass it into a report. Any suggestions that you guys could provide - would be fantastic. Thanks!