Changing the output of Getdate

前端 未结 4 1560
谎友^
谎友^ 2020-12-11 15:57

Is it possible to deceive SQL Server to return a different date on GetDate() without actually changing the machine date?
This would be great, since we have

4条回答
  •  余生分开走
    2020-12-11 16:22

    No, there is not much you can do other than something like this:

    SELECT GETDATE()-7  --get date time 7 days ago
    

提交回复
热议问题