# Building a dataset with \<type 'java.sql.Timestamp'\> and \<type 'java.util.Date'\>

**URL:** <https://forum.inductiveautomation.com/t/building-a-dataset-with-type-java-sql-timestamp-and-type-java-util-date/112452>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [November 26, 2025, 12:36pm UTC](https://forum.inductiveautomation.com/t/building-a-dataset-with-type-java-sql-timestamp-and-type-java-util-date/112452 "2025-11-26T12:36:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielps1818](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@danielps1818](https://forum.inductiveautomation.com/u/danielps1818)\
**Post date:** [November 26, 2025, 12:36pm UTC](https://forum.inductiveautomation.com/t/building-a-dataset-with-type-java-sql-timestamp-and-type-java-util-date/112452/1 "2025-11-26T12:36:51Z")

</div>

I have 2 datasets, one that comes from a query and one that is stored in a tag.

For some reason, there datatype of the tag is \<type 'java.sql.Timestamp'\> and the one returned by the named query is \<type 'java.util.Date'\>.

When doing:

```python
system.dataset.toDataSet(
	list(new_dataset.columnNames),
	filtered_data
)

```

Where filtered\_data is `list(existing_dataset) + list(new_dataset)`.  
The problem is that the first list has the sql type and the other list has util.Date.

```python
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<module:x>", line 471, in function
TypeError: Unable to convert row 11, column 0 to type class java.sql.Timestamp

```

What could I do?  
Thx!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 26, 2025, 1:21pm UTC](https://forum.inductiveautomation.com/t/building-a-dataset-with-type-java-sql-timestamp-and-type-java-util-date/112452/2 "2025-11-26T13:21:51Z")

</div>

Use the `DatasetBuilder` to deliberately set column types, and use `java.util.Date`. `java.sql.Timestamp` is a subclass of `Date`, so can be placed in columns of that type. (But not the reverse.)
