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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join condition with date ranges

Status
Not open for further replies.
Jul 22, 2009
2
US
I have two tables I need to join to an invoice table.

There are 4 primary keys on the invoice table:
account_num upc sales_id date
10 001005 356 04/01/2009

The other two tables, discount and promotion, describe specific incentives that are in place. The structure of these tables is as follows:

account_num upc sales_id begin_date end_date
10 001005 356 01/01/2009 05/31/2009

I'm trying to compare these feilds based on the date of the sale:

invoice.price, discount.price - promotion.price

My problem is I am unsure of how to join the invoice table given I have a date range rather than a list of dates that a particular promotion/discount would be in place.

Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top