How do you get the MAX date on a EPOCH formatted date/time RRS feed

  • Question

  • Looking to get the last date viewed on a program.

    I have tried many ways to reformat this statement with MAX but it always gives me an error.

    ,FORMAT (vt.[lastView], 'MM/dd/yyyy HH:mm') as LastView


    Thursday, January 16, 2020 2:54 PM

All replies

  • What is the relationship your question and this forum? I don't see any. MAX is not in your query so that adds some confusion. And if this gives you an "error", then post the complete error message rather than make everyone guess.

    I think your question can be reduced to "how to convert an (unix?) epoch to datetime". Searching on that will find many suggestions about doing that in tsql (example). But it also seems that you could apply the max aggregate to the epoch value first and then convert. 

    Thursday, January 16, 2020 3:23 PM