Skip to main content
Solved

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

  • February 13, 2023
  • 1 reply
  • 65 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.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • 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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings