
stackoverflow.com
https://stackoverflow.com/questions/77454443/how-c…
sql - How can I use a column's values for DATEADD ()'s datepart ...
CREATE TABLE #Dummy ( Latest_Appointment_Date date, Interval varchar(255), Increment int ); INSERT INTO #Dummy (Latest_Appointment_Date, Interval, Increment) VALUES ('2023-11-10', 'week', 2), ('2023-11-23', 'month', 1); Where the interval and increment columns denote how much I want to increment the date by (using DATEADD, for example). I can't figure out how to use the column values as the ...