# joins with different timeframes tables

**URL:** <https://forum.kx.com/t/joins-with-different-timeframes-tables/7779>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [June 12, 2012, 6:10am UTC](https://forum.kx.com/t/joins-with-different-timeframes-tables/7779 "2012-06-12T06:10:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco1](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@Francisco1](https://forum.kx.com/u/Francisco1)\
**Post date:** [June 12, 2012, 6:10am UTC](https://forum.kx.com/t/joins-with-different-timeframes-tables/7779/1 "2012-06-12T06:10:00Z")

</div>

Hello,

I still have problems understanding joins:

I have a table EU\_W1 with weekly data (open price):

```
<font face='"courier' new monospace><br class='"Apple-interchange-newline"'>Date | W_Open ----------| -------2010.05.01| 1.328752010.05.08| 1.275742010.05.15| 1.235 2010.05.22| 1.257042010.05.29| 1.226382010.06.05| 1.196032010.06.12| 1.210612010.06.19| 1.238 2010.06.26| 1.236942010.07.03| 1.255852010.07.10| 1.263272010.07.17| 1.2922 2010.07.24| 1.291052010.07.31| 1.304512010.08.07| 1.3277 </font>

<font face='"courier' new monospace><br></font>

<font face='"courier' new monospace>And another table EU_D1 with daily data:</font>

<font face='"courier' new monospace><br></font>

Date &nbsp; &nbsp; &nbsp; Open &nbsp; &nbsp;Low &nbsp; &nbsp; Close &nbsp; Trade EntryLevel
------------------------------<wbr style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>---------------------</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.01 1.32875 1.32875 1.32875</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.02 1.3289 1.32865 1.33121 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.03 1.33113 1.3154 1.31955 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.04 1.31953 1.29615 1.29774 -1 1.31913</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.05 1.29769 1.27886 1.2816 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.06 1.28163 1.25148 1.2654 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.07 1.2654 1.25852 1.27524 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.08 1.27574 1.27574 1.27594 1 1.27614</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.09 1.27604 1.275 1.28696 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.10 1.28664 1.27221 1.2737 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.11 1.27373 1.2616 1.26396 -1 1.27333</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.12 1.26398 1.26054 1.26452 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.13 1.26446 1.25163 1.25319 1 1.26486</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.14 1.25319 1.23492 1.23578 -1 1.25279</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.15 1.235 1.235 1.235 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.16 1.23475 1.23338 1.23585 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.17 1.23587 1.22339 1.23825 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.18 1.23827 1.21439 1.21448 0 0</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.19 1.21445 1.21438 1.23842 -1 1.21405</span><br style='"color:' rgb font-family: new monospace text-align: white-space: normal><span style='"color:' rgb font-family: new monospace text-align: white-space: normal>2010.05.20 1.23836 1.22954 1.25398 1 1.23876</span></wbr>

```

How can I add a column to the EU\_D1 table holding the weekly open price (W\_Open) from EU\_W1 table?

Cheers

Francisco

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [June 12, 2012, 7:10am UTC](https://forum.kx.com/t/joins-with-different-timeframes-tables/7779/2 "2012-06-12T07:10:00Z")

</div>

does

aj[`Date;EU\_D1;EU\_W1]

do what you want?

---

<div class="post-metadata">

**Author:** ![Francisco1](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@Francisco1](https://forum.kx.com/u/Francisco1)\
**Post date:** [June 13, 2012, 4:39am UTC](https://forum.kx.com/t/joins-with-different-timeframes-tables/7779/3 "2012-06-13T04:39:00Z")

</div>

Yes!, it does!

Thanks a lot!

Francisco
