I do not know if this is possible, but I would like to fill in a column based on an adjacent column in a SQL Server table.
As below, we would like to dynamically determine the BillingDealerPeriodID by using the 6th and 7th and the 3rd and 4th characters from BillingDateTo.
I am not sure if it matters, but BillingDateTo is also a computed column based on another column BillingDateFrom, which is 7 days from BillingDateFrom.
The formula for the BillingDateTo computed column is:
(dateadd(day,(7),[BillingDateFrom]))
If the result had to be 2102 or 2103 instead of 0221 and 0321, that would be fine too.
BillingDateTo BillingDealerPeriodID 2021-02-28 00:00:00.000 0221 2021-03-07 00:00:00.000 0321