Manipulate Timestamp

I don't know mssql, so I can't say for sure, and I don't understand why the query has every field aliased?
I also don't know what the brackets around timestamp mean, I assume it would be as simple as this.

select Cold, Hot, Total, DATEADD(day, -1, TimeStamp) as TimeStamp
from Flows_DataTotals
order by TimeStamp desc

Im not sure why there is brackets around the TimeStamp, I just used the builder and selected the fields I needed for my reporting. Will give that a shot. Appreciate all your help.

1 Like

Got it sorted out! Thank you so much.

Because timestamp is a reserved word (data type). To use a reserved word as a column name, it must be quoted. MS SQL Server uses non-standard square brackets for identifier quotes.

It is a tip that you should not use that column name.

3 Likes