I am trying to create something that will populate the day of the week in one cell based on a date entered in another, BUT in Master Data Services. I know I will need to do this in a business rule and apply it to the attributes. I am wondering if this can be don using REGEX patterns or any other clever method. So, for example if I have a column with 12/21/2016 in it, I want the next column to say "Wednesday". Thanks!
Asked
Active
Viewed 181 times
1
-
Regex really isn't the right tool for this job. You need a date/calendar library that can tell you that "12/21/2016" is a Wednesday. Many such libraries exist on various platforms, but I'm not familiar at all with whether they exist in the system you're using. – Palpatim Dec 22 '16 at 00:08
1 Answers
0
The simplest way would be using sql and use a calculated column or directly in a view. I'm not that familiar with MDS so there might be a better solution (or not even possible).
alter table mytable add weekday as DATENAME(dw,fieldname) persisted
Do never try to do your own date/time functions, you will fail

user189695
- 56
- 3