<?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: Use date variable in Open Database JSL command in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411046#M66056</link>
    <description>&lt;P&gt;See if this will do what you need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;datetime = "2021-08-01";

// Program opens diagnostic SQL data table for all instruments


Eval(
	Parse(
		"dt.db_diag = Open Database(
\!"DSN=AQM;Description=AQM;UID=sa;PWD=LKJDFDF;Trusted_Connection=No;APP=JMP;WSID=TESTPC;DATABASE=EnvidasConfig;\!",
\!"SELECT * FROM [dbo].MonitorDiagnosticsData WHERE Date_Time &amp;gt;= '"
		 || datetime || "'\!"
);"
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Aug 2021 22:49:23 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-08-18T22:49:23Z</dc:date>
    <item>
      <title>Use date variable in Open Database JSL command</title>
      <link>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411015#M66054</link>
      <description>&lt;P&gt;I have a JSL script that opens a SQL database and then processes the data for various purposes.&amp;nbsp; My challenge is passing a date variable to the Open Database command to further refine the automation of the process.&amp;nbsp; I've tried a whole host of options for trying to do this, but nothing has worked so far.&amp;nbsp; Does anyone have any suggestions for how I can replace the Date_Time value listed in the Open Database command with the variable datetime shown below?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;datetime = "2021-08-01";

// Program opens diagnostic SQL data table for all instruments
dt.db_diag = Open Database(
"DSN=AQM;Description=AQM;UID=sa;PWD=LKJDFDF;Trusted_Connection=No;APP=JMP;WSID=TESTPC;DATABASE=EnvidasConfig;",
"SELECT * FROM [dbo].MonitorDiagnosticsData WHERE Date_Time &amp;gt;= '2021-08-18'"
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:54:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411015#M66054</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2023-06-09T19:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use date variable in Open Database JSL command</title>
      <link>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411046#M66056</link>
      <description>&lt;P&gt;See if this will do what you need&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;datetime = "2021-08-01";

// Program opens diagnostic SQL data table for all instruments


Eval(
	Parse(
		"dt.db_diag = Open Database(
\!"DSN=AQM;Description=AQM;UID=sa;PWD=LKJDFDF;Trusted_Connection=No;APP=JMP;WSID=TESTPC;DATABASE=EnvidasConfig;\!",
\!"SELECT * FROM [dbo].MonitorDiagnosticsData WHERE Date_Time &amp;gt;= '"
		 || datetime || "'\!"
);"
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Aug 2021 22:49:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411046#M66056</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-08-18T22:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Use date variable in Open Database JSL command</title>
      <link>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411250#M66070</link>
      <description>&lt;P&gt;That works perfectly,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also now see where I was putting the ' in the wrong location during my testing.&amp;nbsp; Thanks for the quick and helpful reply.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 14:33:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Use-date-variable-in-Open-Database-JSL-command/m-p/411250#M66070</guid>
      <dc:creator>terapin</dc:creator>
      <dc:date>2021-08-19T14:33:49Z</dc:date>
    </item>
  </channel>
</rss>

