<?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: if statement with datetimeadd invalid type in operator in General Discussions</title>
    <link>https://community.alteryx.com/t5/General-Discussions/if-statement-with-datetimeadd-invalid-type-in-operator/m-p/568662#M2129</link>
    <description>&lt;P&gt;To add days to a date (or datetime) you need to use the DateTimeAdd function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally if [YEAR] is a number type (not a text field) then you need to not have the quotes as it will complain that types don't match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF [YEAR] = 2019 THEN DateTimeAdd([DATE], 365, "days") ELSE [DATE] ENDIF&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should get what you need&lt;/P&gt;</description>
    <pubDate>Tue, 12 May 2020 06:15:52 GMT</pubDate>
    <dc:creator>jdunkerley79</dc:creator>
    <dc:date>2020-05-12T06:15:52Z</dc:date>
    <item>
      <title>if statement with datetimeadd invalid type in operator</title>
      <link>https://community.alteryx.com/t5/General-Discussions/if-statement-with-datetimeadd-invalid-type-in-operator/m-p/568577#M2128</link>
      <description>&lt;P&gt;Hello! I am trying to create this formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF [YEAR] = "2019" THEN [DATE] + 365 ELSE [DATE] ENDIF&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;but it gives me malformed if statement or invalid type in operator error. Please help?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 22:57:54 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/if-statement-with-datetimeadd-invalid-type-in-operator/m-p/568577#M2128</guid>
      <dc:creator>azagrajoanna</dc:creator>
      <dc:date>2020-05-11T22:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: if statement with datetimeadd invalid type in operator</title>
      <link>https://community.alteryx.com/t5/General-Discussions/if-statement-with-datetimeadd-invalid-type-in-operator/m-p/568662#M2129</link>
      <description>&lt;P&gt;To add days to a date (or datetime) you need to use the DateTimeAdd function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally if [YEAR] is a number type (not a text field) then you need to not have the quotes as it will complain that types don't match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF [YEAR] = 2019 THEN DateTimeAdd([DATE], 365, "days") ELSE [DATE] ENDIF&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;should get what you need&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 06:15:52 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/General-Discussions/if-statement-with-datetimeadd-invalid-type-in-operator/m-p/568662#M2129</guid>
      <dc:creator>jdunkerley79</dc:creator>
      <dc:date>2020-05-12T06:15:52Z</dc:date>
    </item>
  </channel>
</rss>

