How convert data types using Convert () Function
Microsoft Net Framework

Convert() Function

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


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM