Link date to a table with Date Range (Eff Date and term date)

G

Guest

I have a price table (A) with multiple reocords and a code to identify each
price and an effective date and termination date.

I also have a much larger table (B) with 2.2 mil records with transaction
and the date they where used. Since the prices change on average quterly and
the file is for 3 years, is there a way to make to make table (B) look at
the code being used and determine rather the date is within the range.
 
P

Pieter Wijnen

Something like

SELECT A.*,B.PRICE FROM TRANS A INNER JOIN PRICES B ON A.ITEMID = B.ITEMID
WHERE A.DATE BETWEEN B.STARTDATE AND B.ENDDATE

might be what you're looking for

Pieter
 

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