Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213916

how to join tables

$
0
0

Hello,

 

I have the following tables I would like to make a new table as per follows

 

join.jpg

 

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 IDUnit IDDate StartDate End
1101/11/201603/11/2016
2210/11/201614/11/2016
3125/11/201626/11/2016

 

Sheet 2 is

Unit IDUnit NameCap
1a10
2b20
3c30
4d40
5c50

 

and Sheet 1 are all the calendar days for the november 2016

 

I am hoping to get :

 

DateIssue IDUnit IDCap
01/11/20161a10
02/11/20161a10
03/11/20161a10
10/11/20162b20
11/11/20162b20
12/11/20162b20
13/11/20162b20
14/11/20162b20
25/11/20163c30
26/11/20163c30

 

Anyone can help ? 

 

Thanks ... 


Viewing all articles
Browse latest Browse all 213916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>