ASP.NET (35) SQL (25) JAVASCRIPT (24) HTML (14) STYLE SHEET (6) ASP (4) SCRIPT (1)

Search me out HERE!!

Retrieve DATE in various format through SQL Query

Below query is used to retrieve DATE in required format through SQL Query.

'SELECT CONVERT(VARCHAR(100),FieldName, 101) AS Sample_date FROM tableName'

Here note that FieldName must of DATETIME or DATE Datatype. Also note that output will be in STRING or VARCHAR Datatype.

You can try out with 100 to 116 Different date format as per your requirement.

No comments:

Post a Comment