Good evening, I'm having trouble putting a date filter, I have a query where I bring the information of CD, Crane and DtRegister (datetime) In this query I am already filtering the 24 hours between the current day and 24 hours before,
GRU_DT_REGISTRO between GETDATE()-1 and GETDATE()
In this filter I try to set it to bring me to from the current date and time, the 24 hours before, however it brings data from 25 hours, or 22:00 today until 22 yesterday, I would like it to display the previous 24 hours without counting the current DateTime, for example are now: 06/08/2017 22:15:00, so in my filter should have dates between 05/08/2017 22:00 & 08/08/2017 21:59:00 Can someone give me some help:
I'm using Sql Server 2014