Skip to main content
Answer

Best approach to handle a date-time-short domain in a look-up column

  • February 13, 2023
  • 1 reply
  • 74 views

Balazs Szeder
Rookie

Hey there,

I have recently encountered an error - which might seem like a bug - about a look-up column. 

In this case we have a sounding date which I would like to attach to a report. Therefore I would like to see the most recent time up until the seconds, which was also confirmed, by a third party. 

So the column itself has a control type - date, but in the GUI this will be set to varchar, which ends up like this

This is not the most charming. So I came up with a 2nd option, by adding a new column to this specific table with a varchar domain. 

Is there maybe a better approach not having the date-time-short domain converted to varchar?

Best answer by Freddy

In SQL server 2022 you’ll have datetrunc() available to truncate to a minute. I now use a custom function that uses dateparts to create new datetime up to minutes.

This topic has been closed for replies.

1 reply

Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • Answer
  • February 13, 2023

In SQL server 2022 you’ll have datetrunc() available to truncate to a minute. I now use a custom function that uses dateparts to create new datetime up to minutes.