<?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: Date Format for a SQL (OSISOFT PI) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36849#M21625</link>
    <description>A few questions here:  are you trying to code the SQL manually or use Query Builder?  Also what version of JMP are you using?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;M</description>
    <pubDate>Tue, 07 Mar 2017 13:30:02 GMT</pubDate>
    <dc:creator>MikeD_Anderson</dc:creator>
    <dc:date>2017-03-07T13:30:02Z</dc:date>
    <item>
      <title>Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36848#M21624</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;after some trying i was able to get data from our PI Archive. We use PI (Osisoft) to archive our process data.&lt;/P&gt;&lt;P&gt;With the following query I got the data but the timestamp is not there:&lt;/P&gt;&lt;PRE&gt;SELECT t1.tag, t1.time, t1.value, t1.svalue,

t1.status, t1.flags

FROM picomp t1

WHERE ( ( ( t1.tag = 'AL2_Geschwindigkeit_Linienmotor_Formerstation' ) AND ( (t1.time &amp;gt;= ( '2017/03/05 1:47:16 PM' )) AND (t1.time &amp;lt;= ( '2017/03/05 2:44:40 PM' )) ) ) )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column for the timestamp is just empty (numeric, continous).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I had the idea that the column for the timestamp is not numeric. I tried to convert the time into date with the follwoing query:&lt;/P&gt;&lt;PRE&gt;SELECT t1.tag, TO_Date(SUBSTR (time, 1, 15),'yyyymmdd') time, t1.value, t1.svalue,

t1.status, t1.flags

FROM picomp t1

WHERE ( ( ( t1.tag = 'AL2_Geschwindigkeit_Linienmotor_Formerstation' ) AND ( (t1.time &amp;gt;= ( '2017/03/05 1:47:16 PM' )) AND (t1.time &amp;lt;= ( '2017/03/05 2:44:40 PM' )) ) ) )&lt;/PRE&gt;&lt;P&gt;But there i got the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[PIODBC] [PIOLEDB] [SUBSTR] Overload resolution failed for (DateTime, Int16, Int16) arguments(s). [SQLSTATE=HY000]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What did I wrong?&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 12:29:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36848#M21624</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-03-07T12:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36849#M21625</link>
      <description>A few questions here:  are you trying to code the SQL manually or use Query Builder?  Also what version of JMP are you using?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;M</description>
      <pubDate>Tue, 07 Mar 2017 13:30:02 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36849#M21625</guid>
      <dc:creator>MikeD_Anderson</dc:creator>
      <dc:date>2017-03-07T13:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36850#M21626</link>
      <description>&lt;P&gt;I use JMP Pro 13.1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I start with the query Builder. But I have to switch to "Custom SQL". Because the Query from the Query Builder does not work. For eample I have to delete the " ; " at the end of the query. And there are some other things. Thats annoying but manageable.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 13:38:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36850#M21626</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-03-07T13:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36852#M21628</link>
      <description>&lt;P&gt;Under the follwoing link you will find an example for this " ; " -Problem from Osisoft.&lt;/P&gt;&lt;P&gt;&lt;A href="https://techsupport.osisoft.com/Troubleshooting/KB/KB01377" target="_blank"&gt;https://techsupport.osisoft.com/Troubleshooting/KB/KB01377&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 13:42:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36852#M21628</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-03-07T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36863#M21634</link>
      <description>I think the ";" issue got fixed in 13.  You might want to give it a try again.  My standard advice for SQL is to let Query Builder do the coding.  If you want to embed the SQL in a JSL application or something you can always pull it out after the fact - but the QB do the heavy lifting so you know it works. &lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;&lt;BR /&gt;M</description>
      <pubDate>Tue, 07 Mar 2017 14:41:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36863#M21634</guid>
      <dc:creator>MikeD_Anderson</dc:creator>
      <dc:date>2017-03-07T14:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36865#M21636</link>
      <description>&lt;P&gt;The ";" issue is still there. But that is not my problem. I can delete it easyly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Problem is that&amp;nbsp;I do not get the time. It seems to be that JMP converts the time data to numeric. But in the PI Archive it seems to be a string or something relative. If I use Microsoft Access I get the time. Access tells me that the data type is "Text". Maybe I will ask OSISOFT directly how I can get the time by a SQL.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 14:55:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36865#M21636</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-03-07T14:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36869#M21637</link>
      <description>&lt;P&gt;Ok...now it works with the following SQL&lt;/P&gt;&lt;PRE&gt;SELECT t1.tag, Cast (time as string) STRING_time, t1.value, t1.svalue,

t1.status, t1.flags

FROM picomp t1

WHERE ( ( ( t1.tag = 'AL2_Geschwindigkeit_Linienmotor_Formerstation' ) AND ( (t1.time &amp;gt;= ( '2017/03/05 1:47:16 PM' )) AND (t1.time &amp;lt;= ( '2017/03/05 2:44:40 PM' )) ) ) )&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:16:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/36869#M21637</guid>
      <dc:creator>mkennke</dc:creator>
      <dc:date>2017-03-07T15:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Date Format for a SQL (OSISOFT PI)</title>
      <link>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/413500#M66315</link>
      <description>&lt;P&gt;I know this is an old post, but check out the &lt;LI-MESSAGE title="Aveva/OSISoft PI Tools" uid="224525" url="https://community.jmp.com/t5/JMP-Add-Ins/Aveva-OSISoft-PI-Tools/m-p/224525#U224525" 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; Add-in, it can help write these queries for you.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Aug 2021 20:14:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Date-Format-for-a-SQL-OSISOFT-PI/m-p/413500#M66315</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2021-08-29T20:14:58Z</dc:date>
    </item>
  </channel>
</rss>

