Tuesday, November 13, 2012

add days to a date in MSSQL

DATEADD(D, 2, @DateToAddTwoDaysTwo) is an example of adding two days to a date in MSSQL. Negative values take you "back in time." http://msdn.microsoft.com/en-us/library/ms186819.aspx seems like a pretty good cheat sheet. It says:

  • y is of year
  • m is of month
  • d is of day
  • h is of hour
  • n is of minute
  • s is of second

No comments:

Post a Comment