lundi 18 juillet 2016

How to set the default value in a Microsoft SQL Server table to yesterday's date

I have a table in Microsoft SQL Server and it is currently set so that when a row is added, it adds the date the row was added to the column name, Date. I did this using getdate() as the default value for this column. The issue is that the data being put in the rows is data from the previous day. How would I set a default value so that when the row is added, instead of adding the current date to the column Date, it adds the previous day's date?

Aucun commentaire:

Enregistrer un commentaire