<?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: How to convert number to date in pass thru query and fetch data particular date ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758057#M239333</link>
    <description>Even i have used single code. but i'm getting zero records  63 columns&lt;BR /&gt;For that i have used trim(tran_date)='&amp;amp;dayminus'&lt;BR /&gt;if i hardcodes like tran_date='20210728' Im getting  3000 records&lt;BR /&gt;</description>
    <pubDate>Thu, 29 Jul 2021 12:19:53 GMT</pubDate>
    <dc:creator>MSK4</dc:creator>
    <dc:date>2021-07-29T12:19:53Z</dc:date>
    <item>
      <title>How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758031#M239314</link>
      <description>&lt;P&gt;Having columns&lt;/P&gt;&lt;P&gt;name&amp;nbsp; amount trandate(in char)&lt;/P&gt;&lt;P&gt;sai&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;400&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210123&lt;/P&gt;&lt;P&gt;goy&amp;nbsp; &amp;nbsp; &amp;nbsp; 500&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;20210524&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i want to fetch data for this date 20210524&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help? Pass thru&amp;nbsp; query only&lt;/P&gt;&lt;P&gt;i have written like this&amp;nbsp; where cast(trandate as date)='20210524'&lt;/P&gt;&lt;P&gt;Plz help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thankin advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758031#M239314</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-29T10:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758032#M239315</link>
      <description>&lt;P&gt;If TRANDATE is a string, why not just&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where TRANDATE='20210524'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&amp;nbsp;&amp;nbsp; (simple or double quotes depending on the platform)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 10:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758032#M239315</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-29T10:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758042#M239324</link>
      <description>Thank you for your answer. But i want t-1 data means yesterday's&lt;BR /&gt;Where i have created macro variable like&lt;BR /&gt;%let dayminus =%sysfunc(intnx(day,%sysfunc(date() ),-1),yymmddn8.);&lt;BR /&gt;It will resolve to 20210728&lt;BR /&gt;I have used in where trandate="&amp;amp;dayminus."&lt;BR /&gt;But throwing error. Any help&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2021 11:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758042#M239324</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-29T11:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758046#M239328</link>
      <description>&lt;P&gt;Does it throw the error because you use double quotes?&lt;/P&gt;
&lt;P&gt;If so, the question has been asked several times here about quoting a macro value with single quotes. Search the forum.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 11:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758046#M239328</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-29T11:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758057#M239333</link>
      <description>Even i have used single code. but i'm getting zero records  63 columns&lt;BR /&gt;For that i have used trim(tran_date)='&amp;amp;dayminus'&lt;BR /&gt;if i hardcodes like tran_date='20210728' Im getting  3000 records&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758057#M239333</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-29T12:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758059#M239334</link>
      <description>Is there any option to covert character number date  into numeric in pass thru query?&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:27:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758059#M239334</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-29T12:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758061#M239336</link>
      <description>&lt;P&gt;I suggest that you first run the query natively in the database.&lt;/P&gt;
&lt;P&gt;Once you have the correct code for that, post it here, so we can suggest ways to build it with SAS.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758061#M239336</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-29T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758065#M239337</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/343672"&gt;@MSK4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Even i have used single code. but i'm getting zero records 63 columns&lt;BR /&gt;For that i have used trim(tran_date)='&amp;amp;dayminus'&lt;BR /&gt;if i hardcodes like tran_date='20210728' Im getting 3000 records&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I doubt than any of the TRAN_DATE values have an ampersand in them so not surprised that you got zero observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try using %BQUOTE() to allow you to add the single quotes and also have the macro processor replace the macro variable reference with its value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;trim(tran_date)= %bquote('&amp;amp;dayminus')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why did you include the TRIM() function call?&amp;nbsp; Are you using ORACLE?&amp;nbsp; Is TRAN_DATE actually a DATETIME variable in the Oracle database?&amp;nbsp; Is it a VARCHAR variable and someone has actually stored trailing spaces into the values?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jul 2021 12:58:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758065#M239337</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-29T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert number to date in pass thru query and fetch data particular date ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758073#M239340</link>
      <description>Yes, Im connecting to Oracle using pass thru query.  Now I got it.</description>
      <pubDate>Thu, 29 Jul 2021 13:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-convert-number-to-date-in-pass-thru-query-and-fetch-data/m-p/758073#M239340</guid>
      <dc:creator>MSK4</dc:creator>
      <dc:date>2021-07-29T13:32:49Z</dc:date>
    </item>
  </channel>
</rss>

