jmontegrosso
jmontegrosso

Reputation: 99

Date format dd/mm in SQL Server

I use SQL Server and I need to display a datetime data type in the following format:

dd/mm

day-month without the year, which is the most effective way?

Upvotes: 1

Views: 10423

Answers (2)

pmbAustin
pmbAustin

Reputation: 3970

You'll find this site really helpful I think:

http://www.sql-server-helper.com/tips/date-formats.aspx

From that link, you can see this as a quick way to get DD/MM:

SELECT CONVERT(VARCHAR(5), GETDATE(), 3) AS [DD/MM]   

Upvotes: 3

Pரதீப்
Pரதீப்

Reputation: 93704

Use 103 style in convert function and remove the year

SELECT LEFT(CONVERT(VARCHAR(15), Getdate(), 103), 5) --11/03

Upvotes: 4

Related Questions