I have a table with 2 columns dateRecieved and dateDue. I know how to make the dateNow column show today's date by default by using: DEFAULT GETDATE() The user can then modify the dateRecieved column to whatever date they want.
After the user modifies the dateRecieved column; how do I set up the dateDue column so that it, by default, shows a date x days away from dateRecieved?
I looked at this answer but I need to refer to another column. Need to add constraint: date plus 10 days
Is there a way that dateRecieved can modify its value automatically when dateRecieved changes? The user should be able to override the default values in both these columns.
I'm using the W3 schools sql tutorial but it didn't have and answer I couldn't find one on stackoverflow either http://www.w3schools.com/sql/sql_default.asp
use current date as default value for a column
Thanks