<?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: help formatting datetime for Oracle pass-through query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636142#M188938</link>
    <description>&lt;P&gt;&lt;FONT size="3"&gt;It seems that oracle expects time in am/pm notation, the format DATEAMPM30.3 should display the datetime in the expected format.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2020 10:09:54 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2020-03-31T10:09:54Z</dc:date>
    <item>
      <title>help formatting datetime for Oracle pass-through query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636133#M188932</link>
      <description>&lt;P&gt;I copied the datetime out of the table but I get an error. The format is&lt;/P&gt;
&lt;P&gt;CREAT_DTTM num format=DATETIME24.3 informat=DATETIME24.3 label='CREAT_DTTM',&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;PRE&gt;and hsc.CREAT_DTTM &amp;gt;= '25MAR2014:14:04:41.652'
and hsc.CREAT_DTTM &amp;lt;= '25MAR2014:14:15:46.424'

ERROR: ORACLE execute error: ORA-01849: hour must be between 1 and 12.&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 09:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636133#M188932</guid>
      <dc:creator>DanD999</dc:creator>
      <dc:date>2020-03-31T09:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: help formatting datetime for Oracle pass-through query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636142#M188938</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;It seems that oracle expects time in am/pm notation, the format DATEAMPM30.3 should display the datetime in the expected format.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 10:09:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636142#M188938</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-03-31T10:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: help formatting datetime for Oracle pass-through query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636200#M188981</link>
      <description>&lt;P&gt;If you're suggesting to change the format of the column to DATEAMPM30.3 that is not possible. I have no control over the format that was chosen. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636200#M188981</guid>
      <dc:creator>DanD999</dc:creator>
      <dc:date>2020-03-31T12:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: help formatting datetime for Oracle pass-through query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636205#M188983</link>
      <description>&lt;P&gt;Are you passing this values within implicit or explicit SQL code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's withing implicit SAS SQL code (=not within a connect to ... bit) then you need to tell SAS that it needs to interpret the string as a datetime value by adding &lt;EM&gt;dt&lt;/EM&gt; after the quote.&lt;/P&gt;
&lt;PRE&gt;and hsc.CREAT_DTTM &amp;gt;= '25MAR2014:14:04:41.652'dt
and hsc.CREAT_DTTM &amp;lt;= '25MAR2014:14:15:46.424'dt&lt;/PRE&gt;
&lt;P&gt;If above works then you're facing another challenge which is about precision when moving floating point values between environments. Let's address this if above is what makes things work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's pass-through SQL then you need to instruct Oracle to interpret the string as a timestamp value. The To_Timestamp() function allows for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/636205#M188983</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-03-31T21:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: help formatting datetime for Oracle pass-through query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/643996#M192288</link>
      <description>&lt;P&gt;Patrick,&lt;/P&gt;
&lt;P&gt;I'm sorry it took me so long to get back to this but it worked. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/help-formatting-datetime-for-Oracle-pass-through-query/m-p/643996#M192288</guid>
      <dc:creator>DanD999</dc:creator>
      <dc:date>2020-04-29T15:20:13Z</dc:date>
    </item>
  </channel>
</rss>

