I don't post often, but I have been banging my head against a wall for a while now and figured I would reach out to the experts. Please note that I was given this project as is because consulting.
I have a table with monthly payment statuses. I need to create actions based off of all 12 statuses i.e. the first record would get an action of "Fully Paid" while the second would get "Need to pay January" and the third would get "Account Hold."
DECLARE @Payments TABLE (January NVARCHAR(20), February NVARCHAR(20), March NVARCHAR(20), April NVARCHAR(20), May NVARCHAR(20), June NVARCHAR(20),
July NVARCHAR(20), August NVARCHAR(20), September NVARCHAR(20), October NVARCHAR(20), November NVARCHAR(20), December NVARCHAR(20))
INSERT @Payments VALUES
('Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid'),
('Unpaid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid'),
('Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Paid','Account Hold')
Does anyone have a recommendation for handling this? The best thing I have come up with is a single column containing all of the payment statuses, so at least I could just reference a single field (i.e. 111111111111 would mean "Fully Paid," 211111111111" would mean "Need to Pay January, " etc.) I am not sure that would even help me out, but I need something better than manually working out all the permutations. Any help is MUCH appreciated.