[SOLVED] Format SQL Query results inside a power table

I have a power table with the following query:

SELECT MachineName, MachineStatus, MachineTag, DateAdded
FROM Table
ORDER BY DateAdded DESC;

Date Added shows up in a typical format YYYY-MM-DD HH:MM:SS but is there a way to format the results of DateAdded to [HH:MM:SS - (01:30:00)] so the results appear as a clock?

Hence a timer starting at -90 minutes and eventually counting up.

If your just talking about changing the date format so it only shows HH:mm:ss, then yes. If you go into the table customizer by right clicking on your power table, you can set your date format to whatever you want it to be in there.

Well I’d like to apply a function on the DateAdded column after it’s been queried from the database.

What kind of function?

You could also format the datetime in your SQL query.

1 Like

Thanks, that was the key to success.

SELECT MachineName, MachineStatus, MachineTag, DATEDIFF(minute, CURRENT_TIMESTAMP, DATEADD(minute, 90, DateAdded)) AS DateAdded FROM Table;