Skip to content
Advertisement

Why does the query not return any data?

I want to retract objects within the dates

Here are all the objects:

enter image description here

And here is the query:

enter image description here

However, if I change the last date to ‘2020-10-10’ everything works

Advertisement

Answer

What is the data type of the column StartDateTime? If it’s datetime, your where clause needs to look like this

WHERE StartDateTime Between Convert(datetime, '2020-09-01', 120) 
      And Convert(datetime, '2020-10-01', 120) 
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement