# Varchar Field Type Changed to Integer, SQL Exception on SUM

**URL:** <https://community.amazonquick.com/t/varchar-field-type-changed-to-integer-sql-exception-on-sum/6596>\
**Category:** Q&A\
**Tags:** data-source, analysis, quick-sight\
**Created:** [October 5, 2022, 8:12am UTC](https://community.amazonquick.com/t/varchar-field-type-changed-to-integer-sql-exception-on-sum/6596 "2022-10-05T08:12:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarrodtb](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jarrodtb](https://community.amazonquick.com/u/jarrodtb)\
**Post date:** [October 5, 2022, 8:12am UTC](https://community.amazonquick.com/t/varchar-field-type-changed-to-integer-sql-exception-on-sum/6596/1 "2022-10-05T08:12:10Z")

</div>

I have a dataset created by a direct query against a Timestream table. In that table is a column with Varchar data known to be Integer data. On the dataset prep page we have changed the column data type to Integer, saved and published. The data appears to load fine as i can see rows from the queried table in the preview window at the bottom of the dataset page.

However, when creating a visualization that SUM’s on the integer column I receive a SQL exception:

```auto
Error executing query with id "null": line 6:90: Unexpected parameters (varchar) for function 'SUM'. Expected: SUM(double) , SUM(bigint) , SUM(interval day to second) ,

```

I’m looking for a way to determine why this exception is being thrown and/or fix the issue. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![jarrodtb](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@jarrodtb](https://community.amazonquick.com/u/jarrodtb)\
**Post date:** [October 5, 2022, 8:39am UTC](https://community.amazonquick.com/t/varchar-field-type-changed-to-integer-sql-exception-on-sum/6596/2 "2022-10-05T08:39:18Z")

</div>

It appears this ended up being due to a filter that was trying to reference an old field. Once that was cleared up the error went away and the visual loaded.
