<?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 proc sql pass through separate time in datetime stamp in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-pass-through-separate-time-in-datetime-stamp/m-p/742251#M232136</link>
    <description>&lt;P&gt;I am trying to separate the time from a datetime stamp field in a passthrough query.&amp;nbsp; I am getting an error that it doesn't recongnize the command 'timepart'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL ;&lt;BR /&gt;CONNECT TO odbc(dsn = 'xxxx' user = xxxxx pw = xxxx);&lt;BR /&gt;CREATE TABLE birds.pn01a AS &lt;BR /&gt;SELECT &lt;BR /&gt;*&lt;BR /&gt;FROM &lt;BR /&gt;connection to odbc&lt;BR /&gt;(&lt;BR /&gt;SELECT TOP 100&lt;BR /&gt;c.ELG_CUSTOMER_BUS_KEY AS Customer_Id,&lt;BR /&gt;p.PRODUCT_CATEGORY_NAME,&lt;BR /&gt;p.PRODUCT_BRAND_NAME,&lt;BR /&gt;p.PRODUCT_SUB_BRAND_NAME,&lt;BR /&gt;p.product,&lt;BR /&gt;f.DATE_KEY,&lt;BR /&gt;timepart(f.transaction_date) as time_,&lt;BR /&gt;f.transaction_date,&lt;BR /&gt;f.transaction_hour,&lt;BR /&gt;f.transaction_minute,&lt;BR /&gt;f."BET AMOUNT" AS Bet_Amt,&lt;BR /&gt;f."NET SALES AMOUNT" as Net_Sales,&lt;BR /&gt;f.transaction_cnt AS Games_Played&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: CLI describe error: [Microsoft][ODBC SQL Server Driver][SQL Server]'timepart' is not a recognized built-in function name. : &lt;BR /&gt;[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.&lt;/P&gt;</description>
    <pubDate>Tue, 18 May 2021 17:56:19 GMT</pubDate>
    <dc:creator>paulsparrow</dc:creator>
    <dc:date>2021-05-18T17:56:19Z</dc:date>
    <item>
      <title>proc sql pass through separate time in datetime stamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-pass-through-separate-time-in-datetime-stamp/m-p/742251#M232136</link>
      <description>&lt;P&gt;I am trying to separate the time from a datetime stamp field in a passthrough query.&amp;nbsp; I am getting an error that it doesn't recongnize the command 'timepart'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC SQL ;&lt;BR /&gt;CONNECT TO odbc(dsn = 'xxxx' user = xxxxx pw = xxxx);&lt;BR /&gt;CREATE TABLE birds.pn01a AS &lt;BR /&gt;SELECT &lt;BR /&gt;*&lt;BR /&gt;FROM &lt;BR /&gt;connection to odbc&lt;BR /&gt;(&lt;BR /&gt;SELECT TOP 100&lt;BR /&gt;c.ELG_CUSTOMER_BUS_KEY AS Customer_Id,&lt;BR /&gt;p.PRODUCT_CATEGORY_NAME,&lt;BR /&gt;p.PRODUCT_BRAND_NAME,&lt;BR /&gt;p.PRODUCT_SUB_BRAND_NAME,&lt;BR /&gt;p.product,&lt;BR /&gt;f.DATE_KEY,&lt;BR /&gt;timepart(f.transaction_date) as time_,&lt;BR /&gt;f.transaction_date,&lt;BR /&gt;f.transaction_hour,&lt;BR /&gt;f.transaction_minute,&lt;BR /&gt;f."BET AMOUNT" AS Bet_Amt,&lt;BR /&gt;f."NET SALES AMOUNT" as Net_Sales,&lt;BR /&gt;f.transaction_cnt AS Games_Played&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR: CLI describe error: [Microsoft][ODBC SQL Server Driver][SQL Server]'timepart' is not a recognized built-in function name. : &lt;BR /&gt;[Microsoft][ODBC SQL Server Driver][SQL Server]Statement(s) could not be prepared.&lt;/P&gt;</description>
      <pubDate>Tue, 18 May 2021 17:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-pass-through-separate-time-in-datetime-stamp/m-p/742251#M232136</guid>
      <dc:creator>paulsparrow</dc:creator>
      <dc:date>2021-05-18T17:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql pass through separate time in datetime stamp</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sql-pass-through-separate-time-in-datetime-stamp/m-p/742257#M232140</link>
      <description>&lt;P&gt;Try using SQL Server syntax inside Pass-thru query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL ;
CONNECT TO odbc(dsn = 'xxxx' user = xxxxx pw = xxxx);
CREATE TABLE birds.pn01a AS
SELECT
*
FROM
connection to odbc
(
SELECT TOP 100
c.ELG_CUSTOMER_BUS_KEY AS Customer_Id,
p.PRODUCT_CATEGORY_NAME,
p.PRODUCT_BRAND_NAME,
p.PRODUCT_SUB_BRAND_NAME,
p.product,
f.DATE_KEY,
&lt;FONT color="#339966"&gt;CONVERT(TIME,f.transaction_date) as time_,&lt;/FONT&gt;
f.transaction_date,
f.transaction_hour,
f.transaction_minute,
f."BET AMOUNT" AS Bet_Amt,
f."NET SALES AMOUNT" as Net_Sales,
f.transaction_cnt AS Games_Played



&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 May 2021 18:03:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sql-pass-through-separate-time-in-datetime-stamp/m-p/742257#M232140</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2021-05-18T18:03:18Z</dc:date>
    </item>
  </channel>
</rss>

