<?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: Pull date from csv and use in calculate (type mismatch) in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167754#M42361</link>
    <description>&lt;P&gt;I actually just changed it for the sake of clarity before posting here, this is not the source of the issues unfortunately. Here are two updated files renamed.&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 22:38:30 GMT</pubDate>
    <dc:creator>js80540</dc:creator>
    <dc:date>2022-04-25T22:38:30Z</dc:date>
    <item>
      <title>Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167741#M42359</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have seen this question pop-up a few times but never really any official answer.&lt;/P&gt;&lt;P&gt;I am pulling a date ("2021-04-01") from a csv file, which I would like to ingest in a form as a date object (using date()) in order to add 21 days to it and check against current date.&lt;BR /&gt;&lt;BR /&gt;I am stuck at the first step though, I can't seem to be able to convert the string of a date to a date object.&lt;/P&gt;&lt;P&gt;So with my date being pulled from the csv and equal to '2022-04-01', stored as test_dob. date(string(${test_dob})) returns mismatch error, but if I do date(string('2022-04-01)) it works no problem.&lt;BR /&gt;&lt;BR /&gt;So it makes me wonder how this date actually get stored in the back-end.&amp;nbsp; And why it displays perfectly but doesn't get ingested as expected in the date function.&lt;/P&gt;&lt;P&gt;I have attached a csv sample and the table from which i am trying to pull (names are fake by the way). I am using the last S123 Connect&lt;/P&gt;&lt;P&gt;Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 21:58:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167741#M42359</guid>
      <dc:creator>js80540</dc:creator>
      <dc:date>2022-04-25T21:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167745#M42360</link>
      <description>&lt;P&gt;My guess would be using the word Date as your column name.&amp;nbsp; That is a reserved word in SQL lite.&amp;nbsp; Try changing it.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 22:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167745#M42360</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-04-25T22:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167754#M42361</link>
      <description>&lt;P&gt;I actually just changed it for the sake of clarity before posting here, this is not the source of the issues unfortunately. Here are two updated files renamed.&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 22:38:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167754#M42361</guid>
      <dc:creator>js80540</dc:creator>
      <dc:date>2022-04-25T22:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167760#M42362</link>
      <description>&lt;P&gt;Yea i cant get a pulldata and date to play nice either.&amp;nbsp; Did you try doing a note, take off the date() part then just bind esri type to date?&amp;nbsp; Might work.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looks like date may need a certain format also.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;date(question, expression, or value)&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Converts a number or string to a date object, without preserving time.&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&lt;SPAN class=""&gt;date('2017-05-28T04:39:02+10:00')&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry all I got&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:05:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167760#M42362</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2022-04-25T23:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167866#M42369</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I simplified it and this is the result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DeonLengton_0-1650967598969.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/39845i9D8A0EC9D04CA1B5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DeonLengton_0-1650967598969.png" alt="DeonLengton_0-1650967598969.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that is the outcome you were hoping for. Here are the calculations:&lt;/P&gt;&lt;TABLE width="159"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="159"&gt;pulldata('permits','date_to_pull','name',${permit_number})&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;${test_dob}+21*24*60*60*1000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first one is still as you had it but i changed it to be a date type.&lt;/P&gt;&lt;TABLE width="540"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="173"&gt;date&lt;/TD&gt;&lt;TD width="173"&gt;test_dob&lt;/TD&gt;&lt;TD width="194"&gt;Date of birth&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second calculation adds 21 days to the test_dob date.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 10:08:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167866#M42369</guid>
      <dc:creator>DeonLengton</dc:creator>
      <dc:date>2022-04-26T10:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Pull date from csv and use in calculate (type mismatch)</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167968#M42373</link>
      <description>&lt;P&gt;Oh wow! Thank you!&lt;BR /&gt;I really wish this was mentioned in the documentation, a few other people seem to have the same issue on the forum since the documentation suggest using date().&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 16:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/pull-date-from-csv-and-use-in-calculate-type/m-p/1167968#M42373</guid>
      <dc:creator>js80540</dc:creator>
      <dc:date>2022-04-26T16:15:04Z</dc:date>
    </item>
  </channel>
</rss>

