In my application I'm writing the dates in this format:
DateTime.Now.ToString("yyyy/MM/dd");
In the database I have: 2016-01-09 00:00:00.000
Now I need to make an appointment where I will bring only the records of the day.
select * from TB_JOGO where DATA_INC = CONVERT(datetime, DATA_INC)
Using a fixed date will bring me this result:
select CONVERT(datetime, '2016-01-09')
Result: 2016-01-09 00: 00: 00,000
Using getdate will bring me this result:
select CONVERT(datetime, getdate())
result: 2016-01-10 21: 57: 45.603
I need the date of the day in this format: 2016-01-09 00:00:00.000
using command getdate()