<?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: where statement not giving the exact results. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813356#M34112</link>
    <description>&lt;P&gt;Maybe just a typo? You say you want "&lt;EM&gt;tx_date prior to the payment date&lt;/EM&gt;", this means that tx_date must be &lt;STRONG&gt;inferior&lt;/STRONG&gt; to paymentdate...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, if paymentdate is not between '23SEP2021'd and '25NOV2021'd then the comparison with tx_date will either be always true or always false.&lt;/P&gt;</description>
    <pubDate>Sat, 14 May 2022 20:02:48 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2022-05-14T20:02:48Z</dc:date>
    <item>
      <title>where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813167#M34101</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am trying to filter on a date column but not getting the result as expected. It gives the same result if I run without that filter. I want tx_date prior to the payment date. Here is the code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Collection as&lt;BR /&gt;select distinct&lt;/P&gt;&lt;P&gt;a.*,&lt;BR /&gt;b.paymentdate,&lt;BR /&gt;b.tx_date,&lt;BR /&gt;b.tran_code,&lt;BR /&gt;sum(b.tx_amount) as Collected&lt;BR /&gt;from Payment_plans_full as a&lt;BR /&gt;inner join ABC.debt_trans as b on a.accountnumber=b.debt_code&lt;BR /&gt;where b.tx_date between '23SEP2021'd and '25NOV2021'd and&lt;BR /&gt;&lt;STRONG&gt;b.tx_date &amp;gt;= b.paymentdate&lt;/STRONG&gt; and&lt;BR /&gt;(b.tran_code like 'DR%'&lt;BR /&gt;and b.tran_code not in ('DR3109', 'DR3108'))&lt;/P&gt;&lt;P&gt;group by a.accountnumber ;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please suggest?&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 10:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813167#M34101</guid>
      <dc:creator>Sandeep77</dc:creator>
      <dc:date>2022-05-13T10:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813169#M34102</link>
      <description>&lt;P&gt;Hello, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're not getting the results you want. The only way we can help is if you provide (a portion of) your data in data set ABC.debt_trans and Payment_plans_full in usable form. Here, "usable form" means SAS data step code, which you can type in yourself, or provide via &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;these instructions&lt;/A&gt;. Other forms of providing the data are not acceptable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future, please provide the data in this forum with your original post. That helps us give you the assistance you need. Don't make us ask to see the data.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 10:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813169#M34102</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-13T10:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813171#M34103</link>
      <description>&lt;P&gt;Investigate one row in our B source table where you would expect the filter to behave differently.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One potential reason why things don't work as you'd expect for&amp;nbsp;&lt;STRONG&gt;b.tx_date &amp;gt;= b.paymentdate&lt;/STRONG&gt;&amp;nbsp;could be that one of the date columns contains a SAS Date value and the other column a SAS DateTime value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can't share the data then at least share a Proc Contents of your source tables.&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 10:54:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813171#M34103</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-13T10:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813198#M34105</link>
      <description>&lt;P&gt;Another approach to troubleshooting&lt;BR /&gt;&lt;BR /&gt;Build you Where clause up, clause by clause checking each time you are getting the results you expect&lt;BR /&gt;e.g.&lt;BR /&gt;Run # 1&amp;nbsp;"&lt;SPAN&gt;where b.tx_date between '23SEP2021'd and '25NOV2021'd"&lt;BR /&gt;Run # 2 "where b.tx_date between '23SEP2021'd and '25NOV2021'd&amp;nbsp;and&amp;nbsp;b.tx_date &amp;gt;= b.paymentdate"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 13:20:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813198#M34105</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-13T13:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813243#M34106</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/391779"&gt;@Sandeep77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;I am trying to filter on a date column but not getting the result as expected.&lt;FONT size="5"&gt;&lt;STRONG&gt; It gives the same result if I run without that filter.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That means the filter is always true. So examine your values closely in the source data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:20:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813243#M34106</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-05-13T15:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: where statement not giving the exact results.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813356#M34112</link>
      <description>&lt;P&gt;Maybe just a typo? You say you want "&lt;EM&gt;tx_date prior to the payment date&lt;/EM&gt;", this means that tx_date must be &lt;STRONG&gt;inferior&lt;/STRONG&gt; to paymentdate...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, if paymentdate is not between '23SEP2021'd and '25NOV2021'd then the comparison with tx_date will either be always true or always false.&lt;/P&gt;</description>
      <pubDate>Sat, 14 May 2022 20:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/where-statement-not-giving-the-exact-results/m-p/813356#M34112</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2022-05-14T20:02:48Z</dc:date>
    </item>
  </channel>
</rss>

