# Remove time (hours/minutes) when filtering power table date column

**URL:** <https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163>\
**Category:** Ignition\
**Created:** [November 29, 2017, 4:30pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163 "2017-11-29T16:30:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dws2384](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dws2384](https://forum.inductiveautomation.com/u/dws2384)\
**Post date:** [November 29, 2017, 4:30pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/1 "2017-11-29T16:30:22Z")

</div>

I have a power table reading a column with a timestamp in it from an SQL database.

I have this column checked as filterable. However because the column is a timestamp when I hit filter i will for example get a list of hundreds of the same date in the dropdown box. this is because it is filtering by the month, day, and exact minute so every entry gets its own filterable option down to the minute.

Is there a way to only filter by day and ignore the hours and minutes in the column?

---

<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 29, 2017, 5:19pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/2 "2017-11-29T17:19:50Z")

</div>

Consider adding another column to your query returning the truncated date. The [date\_trunc()](https://www.postgresql.org/docs/9.5/static/functions-datetime.html) function in PostgreSQL, or the [dateadd/datediff](https://stackoverflow.com/questions/923295/how-can-i-truncate-a-datetime-in-sql-server) dance for SQL Server.

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [November 29, 2017, 5:55pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/3 "2017-11-29T17:55:11Z")

</div>

A simpler way would be to change the Date Format for that column from within the **Table Customizer**.

You may change the format from the default “MMM d, yyyy h:mm a” by clicking on the calendar icon, and selecting another one that will suit your needs.

Table Customizer:

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cda5bb9d9f0084992f8963a0c1527768ff9e86ff.png)

Available formats:  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ac79e0086c2514454b53516fa1062a7ee1395cfa.png)

Cheers!

---

<div class="post-metadata">

**Author:** ![dws2384](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dws2384](https://forum.inductiveautomation.com/u/dws2384)\
**Post date:** [November 29, 2017, 6:16pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/4 "2017-11-29T18:16:53Z")

</div>

Thanks for the suggestions, The issue is that in the table view we need to view the data by month-day-hour-minute as it is a list of alarms. However when clicking on the filter for this column would like to have the smallest filter to be day and ignore the hours and minutes, as of now filtering by date is useless because it only filters one alarm at a time (always revererts to day, hour, minutes)

---

<div class="post-metadata">

**Author:** ![cesrom](https://avatars.discourse-cdn.com/v4/letter/c/ea666f/32.png) [@cesrom](https://forum.inductiveautomation.com/u/cesrom)\
**Post date:** [November 29, 2017, 8:12pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/5 "2017-11-29T20:12:16Z")

</div>

As far as I can tell what @pturmel suggests would be the best solution; add a new column with the Date Format of your choosing.

For MSSQL look into CONVERT()† or FORMAT()\*\*.

† MSSQL 2008+  
\*\* MSSQL 2012+

---

<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 29, 2017, 8:48pm UTC](https://forum.inductiveautomation.com/t/remove-time-hours-minutes-when-filtering-power-table-date-column/16163/6 "2017-11-29T20:48:50Z")

</div>

> [@cesrom](#):
>
> For MSSQL look into CONVERT()† or FORMAT()\*\*.

No, don't. Unless you have CPU cycles in your DB to burn. Follow the StackOverflow link in my prior comment and read the whole thing.
