September 24, 2014 at 4:31 am
Is'n it the expressions you need?
select
timeStart = dateadd(hh, datediff(hh, 0, getdate()) , 0)
,timeEnd = dateadd(hh, datediff(hh, 0, getdate()) + 1, 0)
September 24, 2014 at 5:20 am
One hour, the hour before the hour we are in:
SELECT
timeStart = DATEADD(hour,DATEDIFF(hour,0,getdate())-1,0),
timeEnd =DATEADD(hour,DATEDIFF(hour,0,getdate()),0)
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 24, 2014 at 7:58 pm
Thanks. Is working fine now.
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply