Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server convert to optimal short date

What is the most optimal short date to convert to in SQL Sever to use in a predicate.

I have a date 2013-06-11 15:06:27.000 and want to use the short date part 2013-06-11 in a predicate.

What would be the best short date to convert to in SQL Server for this purpose?

MSDN - Date convert

like image 394
ojhawkins Avatar asked Dec 16 '22 08:12

ojhawkins


1 Answers

Select Convert(DateTime, Convert(VarChar, GetDate(), 12))
like image 120
Naveen Kumar Alone Avatar answered Jan 11 '23 07:01

Naveen Kumar Alone