Reputation: 14148
How do I write TSQL that it calculates the following:
Thanks..
Upvotes: 4
Views: 323
Reputation: 415810
dateadd(dd,datediff(dd,0, getDate()),0)
dateadd(hh,18 + (24 *datediff(dd,0, getDate())),0)
Upvotes: 4
Reputation: 22184
You can try something like the following
SELECT DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0) AS DateNoTime,
DATEADD(hh, 18, DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)) AS DateNewTime
Upvotes: 4