Is suspect this is extremely easy but I'm struggling a little here.
The script below works fine. At the moment it is selecting data by an SQL query where the packhouse is "ALBS"
I want the packhouse value to be selected from a cell within a list in a JMP table. I want to be able to select a cell and open the query relating to that value, rather than "ALBS".
packhouse = "ALBS";
dsn_string = "DSN=TRG-SQL13;UID=;Trusted_Connection=Yes;APP=JMP;WSID=MTMLAP160;DATABASE=ZS_Export";
sql_string = "SELECT top 5 PalletID, dtTempSample, TempSampleValue " ||
" FROM dbo.tb_Raw_Data " ||
" WHERE tb_Raw_Data.SiteName = '" || packhouse || "' " ||
" AND tb_Raw_Data.ShipmentID = 'warehouse' " ||
"order by palletid, dttempsample";
dt = open database(dsn_string, sql_string, packhouse);