如何编写计算以下内容的TSQL:
谢谢..
答案 0 :(得分:4)
dateadd(dd,datediff(dd,0, getDate()),0)
dateadd(hh,18 + (24 *datediff(dd,0, getDate())),0)
答案 1 :(得分:4)
您可以尝试以下内容
SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0) AS DateNoTime,
DATEADD(hh, 18, DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)) AS DateNewTime