<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Script code for join between in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-code-for-join-between/m-p/78391#M36405</link>
    <description>&lt;P&gt;Hi I know you can join tables with JMP. How would I do a join between.&amp;nbsp;In SQL server its something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT * FROM [L].[dbo].[P] P&lt;BR /&gt;INNER JOIN [L].[dbo].[FPD] FPD ON&lt;BR /&gt;P.[Join Date] BETWEEN FPD.[BeginDate] and FPD.[EndDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script builder gives me code like the below with what EQ probably stands for equals. THe between part I added and am trying to figure out the correct way if possible to do in JMP so I don't have to load these tables into sql.&lt;/P&gt;&lt;P&gt;From(&lt;BR /&gt;Table( "pH Kinetics", Alias( "t1" ) ),&lt;BR /&gt;Table(&lt;BR /&gt;"New Dataset for Analysis Final 6",&lt;BR /&gt;Alias( "t2" ),&lt;BR /&gt;Join(&lt;BR /&gt;Type( Left Outer ),&lt;BR /&gt;EQ( Column( "Ferm", "t2" ), Column( "FERM", "t1" ) ) &amp;amp;&lt;BR /&gt;EQ( Column( "Plant", "t2" ), Column( "Plant", "t1" ) )&amp;amp;&lt;BR /&gt;&lt;EM&gt;Between( Column( "Time", "t2" ), Column( "BeginTime", "t1" ), Column( "EndTime", "t1" ) )&lt;/EM&gt;&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 21:47:02 GMT</pubDate>
    <dc:creator>bjbreitling</dc:creator>
    <dc:date>2018-10-08T21:47:02Z</dc:date>
    <item>
      <title>Script code for join between</title>
      <link>https://community.jmp.com/t5/Discussions/Script-code-for-join-between/m-p/78391#M36405</link>
      <description>&lt;P&gt;Hi I know you can join tables with JMP. How would I do a join between.&amp;nbsp;In SQL server its something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;SELECT * FROM [L].[dbo].[P] P&lt;BR /&gt;INNER JOIN [L].[dbo].[FPD] FPD ON&lt;BR /&gt;P.[Join Date] BETWEEN FPD.[BeginDate] and FPD.[EndDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script builder gives me code like the below with what EQ probably stands for equals. THe between part I added and am trying to figure out the correct way if possible to do in JMP so I don't have to load these tables into sql.&lt;/P&gt;&lt;P&gt;From(&lt;BR /&gt;Table( "pH Kinetics", Alias( "t1" ) ),&lt;BR /&gt;Table(&lt;BR /&gt;"New Dataset for Analysis Final 6",&lt;BR /&gt;Alias( "t2" ),&lt;BR /&gt;Join(&lt;BR /&gt;Type( Left Outer ),&lt;BR /&gt;EQ( Column( "Ferm", "t2" ), Column( "FERM", "t1" ) ) &amp;amp;&lt;BR /&gt;EQ( Column( "Plant", "t2" ), Column( "Plant", "t1" ) )&amp;amp;&lt;BR /&gt;&lt;EM&gt;Between( Column( "Time", "t2" ), Column( "BeginTime", "t1" ), Column( "EndTime", "t1" ) )&lt;/EM&gt;&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 21:47:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-code-for-join-between/m-p/78391#M36405</guid>
      <dc:creator>bjbreitling</dc:creator>
      <dc:date>2018-10-08T21:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script code for join between</title>
      <link>https://community.jmp.com/t5/Discussions/Script-code-for-join-between/m-p/78448#M36411</link>
      <description>&lt;P&gt;Below is an example script that shows two methods for specifying a BETWEEN condition.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

//event has a Time variable and really only has events for Entity SPUTTER01
dt1 = Open("C:/temp/event.jmp", Invisible);
//tracker has start times, MoveIn, and end times, MoveOut for many entities 
dt2 = Open("C:/temp/tracker.jmp", Invisible);

//The final result should only have SPUTTER01 data
dt3 = Query(
 Table(dt1, "t1" ), Table(dt2, "t2" ),
    "SELECT t1.Lot, t1.NWafers, t1.OPERATION, t1.SPC_WFRCOUNT, 
		t1.PM_WFRCOUNT, t1.Time,  t2.Entity, t2.SubEntList, t2.MoveIn, t2.MoveOut 
	FROM t1 
		LEFT OUTER JOIN t2 
			ON  (  ( t1.Lot = t2.Lot )  
			AND  ( t1.NWafers = t2.NWafers )  
			AND  ( t1.OPERATION = t2.Operation )  )  
	       WHERE  (  (  ( 1 = 1 )  AND  ( 1 = 1 )  
	       AND  ( t1.Time &amp;gt;= t2.MoveIn and t1.Time &amp;lt;= t2.MoveOut )  )  )"
	);
	
	
	
dt4 = Query(
 Table(dt1, "t1" ), Table(dt2, "t2" ),
    "SELECT t1.Lot, t1.NWafers, t1.OPERATION, t1.SPC_WFRCOUNT, 
		t1.PM_WFRCOUNT, t1.Time,  t2.Entity, t2.SubEntList, t2.MoveIn, t2.MoveOut 
	FROM t1 
		LEFT OUTER JOIN t2 
			ON  (  ( t1.Lot = t2.Lot )  
			AND  ( t1.NWafers = t2.NWafers )  
			AND  ( t1.OPERATION = t2.Operation )  )  
	       WHERE  (  (  ( 1 = 1 )  AND  ( 1 = 1 )  
	       AND  ( t1.Time BETWEEN t2.MoveIn and t2.MoveOut )  )  )"
	);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 07:55:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-code-for-join-between/m-p/78448#M36411</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2018-10-09T07:55:48Z</dc:date>
    </item>
  </channel>
</rss>

