# parseToDate error

**URL:** <https://community.amazonquick.com/t/parsetodate-error/17979>\
**Category:** Q&A\
**Tags:** date, error, quick-sight\
**Created:** [September 13, 2023, 10:09am UTC](https://community.amazonquick.com/t/parsetodate-error/17979 "2023-09-13T10:09:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![svela](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@svela](https://community.amazonquick.com/u/svela)\
**Post date:** [September 13, 2023, 10:09am UTC](https://community.amazonquick.com/t/parsetodate-error/17979/1 "2023-09-13T10:09:54Z")

</div>

I ran the following code:

> parseDate(concat(toString(year), ‘/’, toString(month), ‘/’, toString(day)), [‘yyyy/MM/dd’])

and get the error message " At least one of the arguments in this function does not have correct type. Correct the expression and choose Create again."

The fields year, month and day are IntegerType. Month is coded with single and double place values (1,2,3…10,11,12). The data is imported to Quicksight from Athena.

Any ideas how to solve this problem? Would be very grateful!

---

<div class="post-metadata">

**Author:** ![andres007](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andres007/32/8734_2.png) [@andres007](https://community.amazonquick.com/u/andres007)\
**Post date:** [September 13, 2023, 11:23am UTC](https://community.amazonquick.com/t/parsetodate-error/17979/2 "2023-09-13T11:23:33Z")

</div>

Hi @svela,

You have some square brackets around the date format that should not be there.

The correct formula would like something like this:

```auto
parseDate(concat(toString(year), '/', toString(month), '/', toString(day)), 'yyyy/MM/dd')

```

Kind regards,  
Andres.

---

<div class="post-metadata">

**Author:** ![svela](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@svela](https://community.amazonquick.com/u/svela)\
**Post date:** [September 13, 2023, 11:42am UTC](https://community.amazonquick.com/t/parsetodate-error/17979/3 "2023-09-13T11:42:10Z")

</div>

Dear @andres007,

Thanks for your swift reply. I fixed this but, unfortunately, it does not change anything - same error remains.

---

<div class="post-metadata">

**Author:** ![Sanjeeb2022](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/sanjeeb2022/32/20947_2.png) [@Sanjeeb2022](https://community.amazonquick.com/u/Sanjeeb2022)\
**Post date:** [September 13, 2023, 11:51am UTC](https://community.amazonquick.com/t/parsetodate-error/17979/4 "2023-09-13T11:51:40Z")

</div>

Hi @svela - Can you please share sample data and expected output so that we can try to replicate it from our side and guide you.

Regards - Sanjeeb

---

<div class="post-metadata">

**Author:** ![andres007](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/andres007/32/8734_2.png) [@andres007](https://community.amazonquick.com/u/andres007)\
**Post date:** [September 13, 2023, 11:57am UTC](https://community.amazonquick.com/t/parsetodate-error/17979/5 "2023-09-13T11:57:04Z")

</div>

Can you check the types of quotes you are using? When I paste the code you added in my editor they show incorrectly. You can also try copy/paste the pice of code I put on my original message, that one should not give you any syntax errors.

---

<div class="post-metadata">

**Author:** ![svela](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@svela](https://community.amazonquick.com/u/svela)\
**Post date:** [September 13, 2023, 1:24pm UTC](https://community.amazonquick.com/t/parsetodate-error/17979/6 "2023-09-13T13:24:27Z")

</div>

Thank you @andres007 , the code above did actually work. I marked it as solution. Thanks a lot!!
