<?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 Changing Date Format in Proc SQL in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620867#M19554</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that displays dates in the format "01JAN2020:12:00:00" and I'm trying to pull that data into a newly created table using proc sql without the time.&amp;nbsp; I've done a bit of research on this and can't seem to get the syntax correct (using SELECT CONVERT) and an error when trying to run the query in SAS Enterprise Guide 7.1.&amp;nbsp; Any ideas on how I might be able get rid of time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2020 16:24:57 GMT</pubDate>
    <dc:creator>S0MBR0</dc:creator>
    <dc:date>2020-01-29T16:24:57Z</dc:date>
    <item>
      <title>Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620867#M19554</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table that displays dates in the format "01JAN2020:12:00:00" and I'm trying to pull that data into a newly created table using proc sql without the time.&amp;nbsp; I've done a bit of research on this and can't seem to get the syntax correct (using SELECT CONVERT) and an error when trying to run the query in SAS Enterprise Guide 7.1.&amp;nbsp; Any ideas on how I might be able get rid of time?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 16:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620867#M19554</guid>
      <dc:creator>S0MBR0</dc:creator>
      <dc:date>2020-01-29T16:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620872#M19557</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/258237"&gt;@S0MBR0&lt;/a&gt;&amp;nbsp; Assuming your date is a numeric SAS Datetime value displaying the value using the format Datetime. , the values would of course look like&amp;nbsp;&lt;SPAN&gt;"01JAN2020:12:00:00"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should you require a Date value from a datetime value, You would need to use &lt;STRONG&gt;Datepart&lt;/STRONG&gt; function to extract the date value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select datepart(datetime_var) as new_date format=whatever date format&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 16:30:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620872#M19557</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-29T16:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620873#M19558</link>
      <description>&lt;P&gt;Use format DATETIME7. or DATETIME9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note this is not a DATE format as your title and text imply. These are date/time formats which are not the same as DATE formats and should not be confused with DATE formats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Date/Time formats must be used when your variable is a date/time variable, which your variable is (obviously). Date formats cannot be used on date/time variables, and vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a list of all date, datetime and time formats in alphabetical order, each one clearly states whether it is a date format or a datetime format or a time format.&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-format.htm&amp;amp;locale=en#p0aa41u6lidfz1n1n977se5xgl2s"&gt;https://documentation.sas.com/?cdcId=pgmmvacdc&amp;amp;cdcVersion=9.4&amp;amp;docsetId=allprodslang&amp;amp;docsetTarget=syntaxByCategory-format.htm&amp;amp;locale=en#p0aa41u6lidfz1n1n977se5xgl2s&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 16:47:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620873#M19558</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-29T16:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620904#M19564</link>
      <description>&lt;P&gt;In SAS (and most database systems), there is a fundamental difference between dates and times/datetimes.&lt;/P&gt;
&lt;P&gt;Dates are stored as counts of days (allowing the use of only 4 numeric bytes), while times and datetimes are stored as counts of seconds (in the full 8-byte real format). That's why you need a special format for displaying only the date part of a datetime, or the datepart() function to extract the date out of a datetime value.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 17:06:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620904#M19564</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-01-29T17:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620939#M19568</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;- Thank you for the information, I did not fully grasp the difference between Date and DateTime but your explanation makes a lot of sense.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 18:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620939#M19568</guid>
      <dc:creator>S0MBR0</dc:creator>
      <dc:date>2020-01-29T18:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Date Format in Proc SQL</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620940#M19569</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/133295"&gt;@gpai&lt;/a&gt;&amp;nbsp;- This worked perfectly, thank you so much!&amp;nbsp; I also appreciate the link you provided, it will be a good resource for me going forward.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 18:42:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Changing-Date-Format-in-Proc-SQL/m-p/620940#M19569</guid>
      <dc:creator>S0MBR0</dc:creator>
      <dc:date>2020-01-29T18:42:56Z</dc:date>
    </item>
  </channel>
</rss>

