When you convert expressions from one type to another, in many cases there will be a need within a stored procedure or
other routine to convert data from a datetime type to a varchar type. The Convert function is used for such things.
The CONVERT() function can be used to display date/time data in various formats
For example
We have Getdate function
Select Getdate() as Current_Datetime
It give us current datetime like this [ 2018-03-22 17:40:17.040 ]
If we want to convert Datetime in other format first we conver Datatype
Select convert(varchar(20),GETDATE(),109)
Now it give us Datetime format like this [Mar 22 2018 5:44:29]
Share This with your friend by choosing any social account