I am new to SQL Server and trying to get date from database in the requested format.
I am trying this query to achieve the result.
select *
from datetable
I am new to SQL Server and trying to get date from database in the requested format.
I am trying this query to achieve the result.
select *
from datetable
Another option is Format()
Select Format(somedate,'dd MMM yyyy')
you can use convert function to get required result.
select convert(varchar,getdate(),106)
Result:
06 Jan 2017
If your datatype is DATETIME
or DATETIME2
then you can use CONVERT()
SELECT CONVERT(VARCHAR(12), DATECOLUMN, 106)
FROM DateTable