<?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 Update date field in one table from another table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187791#M47627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;I have a simple sql procedure where I am trying to update one field in a table from another. Both the target and source tables have this field set as MMDDYY10. The SQL syntax works for text data type But not for a date data type. Could someone please tell me what I have to do so that my data gets populated? Code runs with no errors. The target field in this case &lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;ACTUAL_FUNDING_DT shows just a period.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;fproc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.INVENTORY_COPY&amp;nbsp; as u&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ACTUAL_FUNDING_DT= (select ACTUAL_FUNDING_DT from WORK.CONFIG_BACKFILL as n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; u.SIMPLE_ID=n.SIMPLE_ID);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Oct 2014 21:01:05 GMT</pubDate>
    <dc:creator>nimmis</dc:creator>
    <dc:date>2014-10-16T21:01:05Z</dc:date>
    <item>
      <title>Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187791#M47627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;I have a simple sql procedure where I am trying to update one field in a table from another. Both the target and source tables have this field set as MMDDYY10. The SQL syntax works for text data type But not for a date data type. Could someone please tell me what I have to do so that my data gets populated? Code runs with no errors. The target field in this case &lt;SPAN style="color: #000000; font-family: 'Courier New'; background-color: #ffffff;"&gt;ACTUAL_FUNDING_DT shows just a period.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;fproc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-size: 10.0pt; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; work.INVENTORY_COPY&amp;nbsp; as u&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; ACTUAL_FUNDING_DT= (select ACTUAL_FUNDING_DT from WORK.CONFIG_BACKFILL as n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; u.SIMPLE_ID=n.SIMPLE_ID);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 21:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187791#M47627</guid>
      <dc:creator>nimmis</dc:creator>
      <dc:date>2014-10-16T21:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187792#M47628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll bet that you have missing values in the output data for the values of Simple_id in U but not in N but the others updated correctly. Is that the case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187792#M47628</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-16T22:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187793#M47629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All the values in U got a period '.' put in. Nothing got updated correctly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:09:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187793#M47629</guid>
      <dc:creator>nimmis</dc:creator>
      <dc:date>2014-10-16T22:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187794#M47630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Might be time to post a sample of data, just a few records from each data set and just enough variables (if you have more than 3 or 4) to demonstrate the behavior AND what you expect the output to be. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:28:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187794#M47630</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-16T22:28:12Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187795#M47631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a special date format that needs to be put in SAS for date datatype?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187795#M47631</guid>
      <dc:creator>nimmis</dc:creator>
      <dc:date>2014-10-16T22:38:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187796#M47632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dates are integers, basically the number of days since 1 Jan 1960, with special interpretation when used with date functions. An update like this would not be affected by differing formats or even none.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you get any warnings in the Log?&lt;/P&gt;&lt;P&gt;If ALL of the values are set to . then I would verify that the values of SIMPLE_ID are compatible. If they are text you may have issues with leading spaces or possibly encoding.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187796#M47632</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-16T22:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187797#M47633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason I think it is date format is because, I ran this query below. It is essentially the same query. Just updating INDEX_ID&amp;nbsp; which is a text data type instead of date. This one works fine. All the INDEX-ID got updated as expected-wherever there is a match of simple_id in both tables.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;update&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; work.INVENTORY_COPY&amp;nbsp; as u&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; INDEX_ID = (select INDEX_ID from WORK.CONFIG_BACKFILL as n&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: blue; font-family: 'Courier New'; font-size: 10pt;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; u.SIMPLE_ID=n.SIMPLE_ID);&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 22:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187797#M47633</guid>
      <dc:creator>nimmis</dc:creator>
      <dc:date>2014-10-16T22:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187798#M47634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Again;&lt;/P&gt;&lt;P&gt;Post some example data from your data sets that exhibit the error.&lt;/P&gt;&lt;P&gt;Also are you getting any messages in the log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 15:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187798#M47634</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-10-17T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187799#M47635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post a proc contents from both tables?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also do a manual selection to ensure that there is data for what you're trying to backfill in and they aren't actual all missing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 15:21:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/187799#M47635</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-17T15:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Update date field in one table from another table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/394724#M66392</link>
      <description>&lt;P&gt;A bit late, but as I arrived here, maybe it's usefull for another one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are missing one more final "where" clause, that ensures that if there is no correlation between tables, it leaves the actual value, and not an empty value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;update&amp;nbsp;&amp;nbsp; &amp;nbsp;work.INVENTORY_COPY as u&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;set ACTUAL_FUNDING_DT= (&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;select ACTUAL_FUNDING_DT&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;from WORK.CONFIG_BACKFILL as n&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;where u.SIMPLE_ID=n.SIMPLE_ID&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;)&lt;BR /&gt;where u.SIMPLE_ID in (select SIMPLE_ID from WORK.CONFIG_BACKFILL);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More details here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#p0z9p6hclwnhxin1mrewxhdz5f26.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/sqlproc/63043/HTML/default/viewer.htm#p0z9p6hclwnhxin1mrewxhdz5f26.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 16:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Update-date-field-in-one-table-from-another-table/m-p/394724#M66392</guid>
      <dc:creator>eduqlm</dc:creator>
      <dc:date>2017-09-11T16:10:19Z</dc:date>
    </item>
  </channel>
</rss>

