Forum

Can you give some e...
 
Share:
Notifications
Clear all

Can you give some examples using SQL date format dd mm yyyy?

2 Posts
2 Users
0 Reactions
1,587 Views
Posts: 17
Topic starter
(@kumar BI)
Joined: 6 years ago

how to use sql date format dd mm yyyyy or sql date format yyyymmdd


1 Reply
Posts: 18
 VK
Admin
(@vinodkrsetty5895)
Active Member
Joined: 6 years ago

Let us consider the simple calendar table for this example SQL date format dd mm yyyy and date format YYYYMMDD examples.

 

date format ddmmyyyy

 

Calander

date
25-02-2020:00:00:0000

 

Select FORMAT(date,'dd-MM-yyyy') from calendar

 

Here date is a column name in the calendar table

 

It returns date something like 25-02-2020 for date format ddmmyyyy.

 

Select FORMAT(date,'yyyy-MM-dd') from calendar

Returns 2020-02-25 for date format yyyymmdd

 

I can also ignore a specific format something like below.

 

Select FORMAT(date,'yyyy-MM') from calendar

 

Returns 2020-02


Reply

Leave a reply

Author Name

Author Email

Title *

 
Preview 0 Revisions Saved
Share: