<?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 Re: Script - Work with Data Table from OBBC query in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387167#M63743</link>
    <description>&lt;P&gt;Many thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the concept but not able to apply it for my specific case. My query script looks like this right now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New SQL Query(
	Version( 130 ),
	Connection(
		"ODBC:DBQ=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb;DefaultDir=C:\Users\E822710\Desktop\ROTF\Database For JMP;Driver={Microsoft Access Driver (*.mdb, *.accdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
	),
	QueryName( "qProperties" ),
	Select(
		Column( "CaseID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamTag", "t1" ),
		Column( "StreamDescription", "t1" ),
		Column( "QualityID", "t1", Analysis Type( "Nominal" ) ),
		Column( "QualityTag", "t1" ),
		Column( "QualityDescription", "t1" ),
		Column( "Value", "t1", Alias( "StreamQualityValue" ) ),
		Column( "OriginDescription", "t1", Alias( "StreamOriginDescription" ) )
	),
	From( Table( "RW_StreamQualities", Alias( "t1" ) ) ),
	Where(
		In List(
			Column( "QualityTag", "t1" ),
			{"CRB"},
			UI( SelectListFilter( ListBox, Base( "Categorical" ) ) )
		)
	),
	Order By(
		Column( "CaseID", "t1", Order( "Ascending" ) ),
		Column( "StreamReportOrder", "t1", Order( "Ascending" ) ),
		Column( "QualityReportOrder", "t1", Order( "Ascending" ) )
	)
) &amp;lt;&amp;lt; Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize I should have just shared my script right away.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your further guidance.&lt;/P&gt;</description>
    <pubDate>Thu, 20 May 2021 10:22:47 GMT</pubDate>
    <dc:creator>JRS</dc:creator>
    <dc:date>2021-05-20T10:22:47Z</dc:date>
    <item>
      <title>Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/386960#M63713</link>
      <description>&lt;P&gt;Hi Everyone -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with two datasets stored in Microsoft Access database, which I get through ODCB queries. I need to join the two resulting data tables, before I make some more data manipulations.&lt;/P&gt;&lt;P&gt;I have scripted the whole process, however it doesn't not run fully at once. I always have to first run the script for the two ODCB queries, then run my script for tables joining and other manipulations.&lt;/P&gt;&lt;P&gt;Else I get an error message: "&lt;EM&gt;cannot locate data table in access or evaluation of 'data table' ,&amp;nbsp; Data Table/*###*/("qStreams")&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;("qStreams" being of the two tables I got from ODCB query).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel I may need to add some script to store/declare the data tables I get from the ODCB queries in order to use it later, and this is where I am stuck, because I am very unfamiliar with JSL script (this is my first script actually).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:47:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/386960#M63713</guid>
      <dc:creator>JRS</dc:creator>
      <dc:date>2023-06-09T19:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/386989#M63717</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/23952"&gt;@JRS&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try retaining a reference to the data tables you open with each ODBC connection and using those instead of calling by name, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = Open Database( "DSN=My Data Source Name", "SELECT * FROM table1" );
dt2 = Open Database( "DSN=My Data Source Name", "SELECT * FROM table2" );

dt1 &amp;lt;&amp;lt; Join(
	With( dt2 ),
	...
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 May 2021 19:26:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/386989#M63717</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-05-19T19:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387167#M63743</link>
      <description>&lt;P&gt;Many thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the concept but not able to apply it for my specific case. My query script looks like this right now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New SQL Query(
	Version( 130 ),
	Connection(
		"ODBC:DBQ=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb;DefaultDir=C:\Users\E822710\Desktop\ROTF\Database For JMP;Driver={Microsoft Access Driver (*.mdb, *.accdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
	),
	QueryName( "qProperties" ),
	Select(
		Column( "CaseID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamTag", "t1" ),
		Column( "StreamDescription", "t1" ),
		Column( "QualityID", "t1", Analysis Type( "Nominal" ) ),
		Column( "QualityTag", "t1" ),
		Column( "QualityDescription", "t1" ),
		Column( "Value", "t1", Alias( "StreamQualityValue" ) ),
		Column( "OriginDescription", "t1", Alias( "StreamOriginDescription" ) )
	),
	From( Table( "RW_StreamQualities", Alias( "t1" ) ) ),
	Where(
		In List(
			Column( "QualityTag", "t1" ),
			{"CRB"},
			UI( SelectListFilter( ListBox, Base( "Categorical" ) ) )
		)
	),
	Order By(
		Column( "CaseID", "t1", Order( "Ascending" ) ),
		Column( "StreamReportOrder", "t1", Order( "Ascending" ) ),
		Column( "QualityReportOrder", "t1", Order( "Ascending" ) )
	)
) &amp;lt;&amp;lt; Run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize I should have just shared my script right away.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your further guidance.&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 10:22:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387167#M63743</guid>
      <dc:creator>JRS</dc:creator>
      <dc:date>2021-05-20T10:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387264#M63758</link>
      <description>&lt;P&gt;You would set a variable equal to the value of New SQL Query.&amp;nbsp; Using the highest level functions of your script, it might look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;//Get data
dtqStreams = New SQL Query( ... ) &amp;lt;&amp;lt; Run;
dtqProperties = New SQL Query( ... ) &amp;lt;&amp;lt; Run;

// Join both Data Tables
dtJoined = dtqStreams &amp;lt;&amp;lt; Join( With( dtqProperties ), ... );

// Set column properties
dtJoined:"StreamFeedFlag"n &amp;lt;&amp;lt; Add Column Properties( ... );

// Add new columns
dtJoined &amp;lt;&amp;lt; New Column( ... );

// Make graphs from your joined data table
dtJoined &amp;lt;&amp;lt; Graph Builder( ... );
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 16:32:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387264#M63758</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-05-20T16:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387729#M63794</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still having some issue around joining both tables, here is the script I implemented following your post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Join both Data Tables
dtJoined = dtqStreams &amp;lt;&amp;lt; Join(
	With( dtqProperties ),
	Merge Same Name Columns,
	Match Flag( 0 ),
	By Matching Columns( :CaseID = :CaseID, :StreamID = :StreamID ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 ),
	Output Table( "UnitBalance.HY%" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But it still gives an error:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JRS_0-1621757466194.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33035i98C1060ACCF9F452/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JRS_0-1621757466194.png" alt="JRS_0-1621757466194.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 08:12:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387729#M63794</guid>
      <dc:creator>JRS</dc:creator>
      <dc:date>2021-05-23T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387980#M63817</link>
      <description>&lt;P&gt;So here I have to admit that I don't use New SQL Query very often.&amp;nbsp; Your code &lt;EM&gt;looks&amp;nbsp;&lt;/EM&gt;correct.&amp;nbsp; Two ideas here, one that you&amp;nbsp;&lt;EM&gt;might&amp;nbsp;&lt;/EM&gt;need to put parentheses around (New SQL Query( ... ) &amp;lt;&amp;lt; Run), and another is to include a wait statement to make sure the queries actually evaluate before moving forward.&amp;nbsp; Try running your code one line at a time, and see if the n row functions returns the number you expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;//Get data
dtqStreams = (New SQL Query( ... ) &amp;lt;&amp;lt; Run);
dtqProperties = (New SQL Query( ... ) &amp;lt;&amp;lt; Run);

//Make sure everything evaluates
wait(1);

//check that table contains values
n row( dtqStreams );

// Join both Data Tables
dtJoined = dtqStreams &amp;lt;&amp;lt; Join( With( dtqProperties ), ... );

// Set column properties
dtJoined:"StreamFeedFlag"n &amp;lt;&amp;lt; Add Column Properties( ... );

// Add new columns
dtJoined &amp;lt;&amp;lt; New Column( ... );

// Make graphs from your joined data table
dtJoined &amp;lt;&amp;lt; Graph Builder( ... );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 May 2021 18:54:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/387980#M63817</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-05-24T18:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388644#M63874</link>
      <description>&lt;P&gt;Thanks for taking the time to look into it. Unfortunately that did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have reached out to the JMP support, but have heard back from them till now. Not sure if they address this kind of technical query.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 10:11:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388644#M63874</guid>
      <dc:creator>JRS</dc:creator>
      <dc:date>2021-05-27T10:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388701#M63881</link>
      <description>&lt;P&gt;Are you running the query in foreground or in the background (I think this is preference dependant but you can force it)? If they are run in the background it could mean that the queries do not finish before you try to join datatables together.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:09:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388701#M63881</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-05-27T14:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388702#M63882</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/14366"&gt;@jthi&lt;/a&gt;&amp;nbsp;good thought!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this is the issue, this post might help:&amp;nbsp;&lt;LI-MESSAGE title="Run queries in background, wait for them to complete, and reference them in the remaining JSL script" uid="274591" url="https://community.jmp.com/t5/JMP-Scripts/Run-queries-in-background-wait-for-them-to-complete-and/m-p/274591#U274591" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:13:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388702#M63882</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-05-27T14:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script - Work with Data Table from OBBC query</title>
      <link>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388724#M63884</link>
      <description>&lt;P&gt;JMP support guys did respond but it was in my junk box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They suggested just as you mentioned, and it worked just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pasting their detailed feedback for everyone's benefit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;SPAN class="csf53863ff1"&gt;================================================================================================&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Sending the &amp;lt;&amp;lt;Run message to New SQL Query() causes JMP to use the Query Builder preference for running queries. Unless you have updated your preferences, SQL Queries are run in the background by default. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs746a5fab"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Arial',sans-serif; color: black;"&gt;&lt;!--  [if gte vml 1]&amp;gt;&amp;lt;v:shapetype id=&amp;quot;_x0000_t75&amp;quot; coordsize=&amp;quot;21600,21600&amp;quot;
 o:spt=&amp;quot;75&amp;quot; o:preferrelative=&amp;quot;t&amp;quot; path=&amp;quot;m@4@5l@4@11@9@11@9@5xe&amp;quot; filled=&amp;quot;f&amp;quot;
 stroked=&amp;quot;f&amp;quot;&amp;gt;
 &amp;lt;v:stroke joinstyle=&amp;quot;miter&amp;quot;/&amp;gt;
 &amp;lt;v:formulas&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;if lineDrawn pixelLineWidth 0&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;sum @0 1 0&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;sum 0 0 @1&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @2 1 2&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @3 21600 pixelWidth&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @3 21600 pixelHeight&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;sum @0 0 1&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @6 1 2&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @7 21600 pixelWidth&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;sum @8 21600 0&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;prod @7 21600 pixelHeight&amp;quot;/&amp;gt;
  &amp;lt;v:f eqn=&amp;quot;sum @10 21600 0&amp;quot;/&amp;gt;
 &amp;lt;/v:formulas&amp;gt;
 &amp;lt;v:path o:extrusionok=&amp;quot;f&amp;quot; gradientshapeok=&amp;quot;t&amp;quot; o:connecttype=&amp;quot;rect&amp;quot;/&amp;gt;
 &amp;lt;o:lock v:ext=&amp;quot;edit&amp;quot; aspectratio=&amp;quot;t&amp;quot;/&amp;gt;
&amp;lt;/v:shapetype&amp;gt;&amp;lt;v:shape id=&amp;quot;_x0000_i1025&amp;quot; type=&amp;quot;#_x0000_t75&amp;quot; alt=&amp;quot;&amp;quot; style='width:433.5pt;
 height:540.75pt'&amp;gt;
 &amp;lt;v:imagedata src=&amp;quot;file:///C:/Users/E822710/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png&amp;quot;
  o:href=&amp;quot;cid:2580654616946508228&amp;quot;/&amp;gt;
&amp;lt;/v:shape&amp;gt;&amp;lt;![endif] --&gt;&amp;lt;![if !vml]&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JRS_0-1622126611880.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/33099i962A49B79CE7192B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JRS_0-1622126611880.png" alt="JRS_0-1622126611880.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs746a5fab"&gt;&lt;SPAN style="font-size: 10.5pt; font-family: 'Arial',sans-serif; color: black;"&gt;&amp;lt;![endif]&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs746a5fab"&gt;&lt;SPAN class="cs3b9e10371"&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Use &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="cs19cf610d1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;lt;&amp;lt;Run Foreground&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; with the &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="cs19cf610d1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;OnRunComplete&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt; option to assign a reference to the imported table. &amp;nbsp;This will cause your script to wait for the query to complete. &amp;nbsp;Additionally, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="csf593b1001"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Query Builder creates a symbol that is only available to the OnRunComplete() script called 'queryResult.' This symbol is a reference to the resulting table&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs746a5fab"&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="csd410b6881"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;lt;&amp;lt; Run Foreground( On Run Complete( dt = queryResult ) );&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;SPAN class="cs3b9e10371"&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;SPAN class="csf53863ff1"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;You can read more about the available functions and their arguments the the &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/sql-functions.shtml" target="_blank"&gt;&lt;SPAN class="csb7ce8bea1"&gt;SQL Functions&lt;/SPAN&gt;&lt;/A&gt; section of the JSL Syntax Reference.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs2654ae3a"&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN class="csf53863ff1"&gt;================================================================================================&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in application:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtqProperties = (New SQL Query(
	Version( 130 ),
	Connection(
		"ODBC:DBQ=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb;DefaultDir=C:\Users\E822710\Desktop\ROTF\Database For JMP;Driver={Microsoft Access Driver (*.mdb, *.accdb)};DriverId=25;FIL=MS Access;FILEDSN=C:\Users\E822710\Desktop\ROTF\Database For JMP\Results.Mdb.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
	),
	QueryName( "qProperties" ),
	Select(
		Column( "CaseID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamID", "t1", Analysis Type( "Nominal" ) ),
		Column( "StreamTag", "t1" ),
		Column( "StreamDescription", "t1" ),
		Column( "QualityID", "t1", Analysis Type( "Nominal" ) ),
		Column( "QualityTag", "t1" ),
		Column( "QualityDescription", "t1" ),
		Column( "Value", "t1", Alias( "StreamQualityValue" ) ),
		Column( "OriginDescription", "t1", Alias( "StreamOriginDescription" ) )
	),
	From( Table( "RW_StreamQualities", Alias( "t1" ) ) ),
	Where(
		In List(
			Column( "QualityTag", "t1" ),
			{"CRB"},
			UI( SelectListFilter( ListBox, Base( "Categorical" ) ) )
		)
	),
	Order By(
		Column( "CaseID", "t1", Order( "Ascending" ) ),
		Column( "StreamReportOrder", "t1", Order( "Ascending" ) ),
		Column( "QualityReportOrder", "t1", Order( "Ascending" ) )
	)
) &amp;lt;&amp;lt; Run Foreground( On Run Complete( dt = queryResult ) ));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 14:45:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Script-Work-with-Data-Table-from-OBBC-query/m-p/388724#M63884</guid>
      <dc:creator>JRS</dc:creator>
      <dc:date>2021-05-27T14:45:27Z</dc:date>
    </item>
  </channel>
</rss>

