1
In my application I am recording 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 a query 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 the getdate will bring me this result:
select CONVERT(datetime, getdate())
Result: 2016-01-10 21:57:45.603
I need the date of day in this format : 2016-01-09 00:00:00.000
using command getdate()
Right answer, immensely grateful.
– Harry