How to use REGEX patterns to return day of the week if a date is entered?

219 views Asked by At

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!

1

There are 1 answers

0
user189695 On

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