Select Only Date Part From DateTime

When run following command it also provide the time along with date.
SELECT GETDATE()

Result
2011-05-10 14:26:39.607

The required outcome was only 05/10/2011.

So for this above outcome query is..

SELECT CONVERT(VARCHAR(10),GETDATE(),101)

if you want Result like

2011/05/10

then query will be like

SELECT CONVERT(VARCHAR(10),GETDATE(),111)


Ebook Download
View all
Learn
View all