devxlogo

Format the Given Date into a Required Date Format

Format the Given Date into a Required Date Format

You can change the given format into the required date format using the CONVERT Function. Here’s an example:

 companyid   peo----------- -----------104         1998-09-30104         1999-09-30104         1999-12-31104         2000-03-31104         2000-06-30104         2000-09-30104         2000-12-31104         2001-03-31104         2001-06-30104         2001-09-30(10 row(s) affected)'///////////////////////////////////select distinct companyid ,CONVERT(char(10) , peo ,101) Style1,CONVERT(char(10) , peo ,103) Style2 from fintabdatamin where companyid=104companyid   Style1     Style2----------- ---------- ----------104         09/30/1998 30/09/1998104         09/30/1999 30/09/1999104         09/30/2000 30/09/2000104         09/30/2001 30/09/2001104         03/31/2000 31/03/2000104         06/30/2001 30/06/2001104         03/31/2001 31/03/2001104         12/31/1999 31/12/1999104         06/30/2000 30/06/2000104         12/31/2000 31/12/2000(10 row(s) affected)
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist