<?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: Proc SQL Where Clause with Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671676#M201736</link>
    <description>I tried that, but I got this message:&lt;BR /&gt;WARNING: This SAS global statement is not supported in PROC SQL. It has been ignored.</description>
    <pubDate>Thu, 23 Jul 2020 06:31:35 GMT</pubDate>
    <dc:creator>SaschaD</dc:creator>
    <dc:date>2020-07-23T06:31:35Z</dc:date>
    <item>
      <title>Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671422#M201626</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to add to my where clause a calculated date like Today()-1, but I got always the error that the datatypes differs.&lt;/P&gt;&lt;P&gt;The format from the salesday are YYYYMMDD and numeric.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;PROC SQL;
	CREATE TABLE WORK.NG_Export AS
		SELECT
			T1.SAS_ID__c,
			T1.Salesday__c,
		FROM APPG.KOPIE_V_APP_NG T1
		WHERE 
			T1.Salesday__c = PUT(INTNX('Day', TODAY(), -1, 'SAME'), yymmddn8.);

QUIT;&lt;/PRE&gt;&lt;P&gt;Could you help me plase.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sascha&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 15:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671422#M201626</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2020-07-22T15:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671427#M201629</link>
      <description>&lt;P&gt;This line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;T1.Salesday__c = PUT(INTNX('Day', TODAY(), -1, 'SAME'), yymmddn8.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;T1.Salesday__c is numeric, PUT(...) is character, you can't have that, you can only compare a numeric to a numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I don't have your data, it may be (or may not be) that this works&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;T1.Salesday__c = INTNX('Day', TODAY(), -1, 'SAME')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 15:11:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671427#M201629</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-22T15:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671671#M201731</link>
      <description>&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it doesn't work, because the value of&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;INTNX('Day', TODAY(), -1, 'SAME')&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is 22118.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I need the format YYYYMMDD like 20200722.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The values of salesday also have this format.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 05:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671671#M201731</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2020-07-23T05:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671672#M201732</link>
      <description>&lt;P&gt;The format is just the way the value is &lt;EM&gt;displayed&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The test uses the actual value, regardless of the format. otherwise two dates formatted differently wouldn't match, which is silly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the parameter 'same' has no effect here and can be removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 06:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671672#M201732</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-23T06:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671674#M201734</link>
      <description>&lt;P&gt;Ok, but what should I do now?&lt;/P&gt;&lt;P&gt;The result is the same, I got the value 22118.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The structure of today should be 20200722 numeric, how can I convert the date to this format?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 06:17:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671674#M201734</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2020-07-23T06:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671675#M201735</link>
      <description>&lt;P&gt;Are you saying that variable&amp;nbsp;SALESDAY__C&amp;nbsp; is numeric with value&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;20200722&amp;nbsp;?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;That's a silly way to code dates. Change this if you can.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For that value, you can compare two strings:&lt;/P&gt;
&lt;PRE&gt;where put(T1.SALESDAY__C,8.) = put(intnx('day', today(), -1) , yymmddn8.);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 06:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671675#M201735</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-23T06:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671676#M201736</link>
      <description>I tried that, but I got this message:&lt;BR /&gt;WARNING: This SAS global statement is not supported in PROC SQL. It has been ignored.</description>
      <pubDate>Thu, 23 Jul 2020 06:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671676#M201736</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2020-07-23T06:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671677#M201737</link>
      <description>Probably too many semicolons.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jul 2020 06:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671677#M201737</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-23T06:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Proc SQL Where Clause with Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671678#M201738</link>
      <description>Yeah, you are right, Thanks. My fault.</description>
      <pubDate>Thu, 23 Jul 2020 06:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-SQL-Where-Clause-with-Date/m-p/671678#M201738</guid>
      <dc:creator>SaschaD</dc:creator>
      <dc:date>2020-07-23T06:36:27Z</dc:date>
    </item>
  </channel>
</rss>

