How to display current date in given format.
Display current date as Dec/28/12 in SQL Server.
Thanks,
Purushottam
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mangesh GPosted Dec 29, 2016, 3:53 AM
Nirav DaraniyaPosted Dec 29, 2016, 1:37 AM
Try this
SELECT FORMAT(convert(datetime,coldate),'MMM/dd/MM') AS PerDate
Purushottam KumarPosted Dec 29, 2016, 1:26 AM
Nirav DaraniyaPosted Dec 28, 2016, 11:21 PM
Simple for getting any datetime format you can use FORMAT function in SQL.
Example:
SELECT FORMAT(getdate(),'MMM/dd/MM') AS PerDate.
Output:
Dec/29/12
Daniel JonesPosted Dec 28, 2016, 11:21 PM
Khaja MoizuddinPosted Dec 28, 2016, 11:44 AM
Mangesh GPosted Dec 28, 2016, 8:59 AM