Hello,
I have the following tables I would like to make a new table as per follows
select
Issue ID
Unit Name
Cap
Date
From
Sheet1 join Sheet2, Sheet3
Where
(Sheet3.Unit ID = Sheet2.Unit ID) and
((Sheet1 Date >= Sheet3.Date Start) and (Sheet1 Date <= Sheet3.Date End))
Assuming Sheet3 is
Issue ID | Unit ID | Date Start | Date End |
1 | 1 | 01/11/2016 | 03/11/2016 |
2 | 2 | 10/11/2016 | 14/11/2016 |
3 | 1 | 25/11/2016 | 26/11/2016 |
Sheet 2 is
Unit ID | Unit Name | Cap |
1 | a | 10 |
2 | b | 20 |
3 | c | 30 |
4 | d | 40 |
5 | c | 50 |
and Sheet 1 are all the calendar days for the november 2016
I am hoping to get :
Date | Issue ID | Unit ID | Cap |
01/11/2016 | 1 | a | 10 |
02/11/2016 | 1 | a | 10 |
03/11/2016 | 1 | a | 10 |
10/11/2016 | 2 | b | 20 |
11/11/2016 | 2 | b | 20 |
12/11/2016 | 2 | b | 20 |
13/11/2016 | 2 | b | 20 |
14/11/2016 | 2 | b | 20 |
25/11/2016 | 3 | c | 30 |
26/11/2016 | 3 | c | 30 |
Anyone can help ?
Thanks ...