How to offset getdate() column

  Kiến thức lập trình

In my one table I have a date column who’s default value is GETDATE()
However, I would like to have that time be set back 3 hours.
What would be the best way to that?

Default value set is GETDATE() Column Properties

New contributor

CalebZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

3

You’ll want to set your “Default Value or Binding” to:

SELECT (dateadd(hour,(-3),getdate()))

LEAVE A COMMENT