How to remove product join and loop the query

Database

How to remove product join and loop the query

select t3.code, t3.storenum, t4.itemid, t4.price 

from sales t4

join (select t1.code as code, t1.storenum as storenum, t2.year as year, t2.week as week

from store t1 join dates t2 on t2.cal_date between t1.startdate and t1.enddate) t3

on t3.year = t4.year

and t3.week = t4.week

and t3.storenum = t4.storenum

store  table data:

code  storenum  startdate  enddate

1              1            01/01/2015   12/31/2015

1              2      05/01/2015   12/31/2015

1              3      05/01/2015   12/31/2015

2              2            01/01/2015   12/31/2015

2              3      05/01/2015   12/31/2015

2              4      04/01/2015   12/31/2015

3              1            05/01/2015   11/31/2015

3              3      05/01/2015   12/31/2015

3              4      04/01/2015   12/31/2015

date table data:

cal_date          year   week

01/01/2015   2015    01

02/09/2015   2015    07

04/06/2015   2015    15

06/01/2015   2015    23

sales  table   data:

itemid storenum  price   year    week

1             1             100    2015    15

2             1             50     2015    15

1             2             1000    2015    15

2             3             55     2015    15

1             3             100    2015    21

2             4             50     2015    18

1             5             100    2015    19

2             6             50     2015    20

Here i am trying to get code,storenum,itemid and price based on code start date and end date. For one particular date mulitple codes are active,  so it will get all the participating storenum from store table. Then by using that storenum it have to pick all  itemid and price from sales table. When i am trying to run above query it going to product join.

when i run above query it will get multiple codes and every code contains multiple storenum and few storenum will be same in all codes. If i select one code manually i am getting  correct results, is there any way of looping above query to run each time for one particular code or is there any way to  slove this 

Please help me

Thanks,