# SQL Timestamp Format

**URL:** <https://forum.inductiveautomation.com/t/sql-timestamp-format/84076>\
**Category:** Ignition\
**Created:** [January 10, 2024, 8:47pm UTC](https://forum.inductiveautomation.com/t/sql-timestamp-format/84076 "2024-01-10T20:47:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CWHITE](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@CWHITE](https://forum.inductiveautomation.com/u/CWHITE)\
**Post date:** [January 10, 2024, 8:47pm UTC](https://forum.inductiveautomation.com/t/sql-timestamp-format/84076/1 "2024-01-10T20:47:16Z")

</div>

Is there a way to take a SQL tag history query that would then, when exported to .csv could break out the timestamp column into two columns? One for date and one for time?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 10, 2024, 9:09pm UTC](https://forum.inductiveautomation.com/t/sql-timestamp-format/84076/2 "2024-01-10T21:09:42Z")

</div>

Show us how you're retrieving the data.

- If you're using a tag history binding then you'll need a script transform.
- If you're writing your own SQL query you can use SQL's CONVERT function.

> **[MySQL CONVERT() Function](https://www.w3schools.com/sql/func_mysql_convert.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

> **[SQL Server CONVERT() Function](https://www.w3schools.com/sql/func_sqlserver_convert.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
