0

I'm facing an issue when trying to add a condition in my sql request
I want add a condition i.e date between DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0) and current date until 23:59:59.
How can I specify the second part of condition?
thank you.

Praveen
  • 8,945
  • 4
  • 31
  • 49
gilas
  • 43
  • 6
  • 1
    possible duplicate of [Get row where datetime column = today - SQL server noob](http://stackoverflow.com/questions/2583228/get-row-where-datetime-column-today-sql-server-noob) – Patrick Hofman Sep 21 '15 at 10:47

2 Answers2

2

You can do with predicate:

someDate < dateadd(dd, 1, cast(getdate() as date))
Giorgi Nakeuri
  • 35,155
  • 8
  • 47
  • 75
0

I usually go with the following:

somedate >= cast(floor(cast getdate() as float) as datetime) and somedate < cast(ceiling(cast getdate() as float) as datetime)
KaraokeStu
  • 758
  • 7
  • 17