Nida
Nida

Reputation: 1702

How to change Date format to yyyy-mm-dd

I want to change output date format of parameter @DateIssued to "2013-12-31" format.

Upvotes: 1

Views: 172

Answers (2)

X.Otano
X.Otano

Reputation: 2169

What you want:

CONVERT(VARCHAR(10),@DateIssued,21) 

Upvotes: 1

Rahul Tripathi
Rahul Tripathi

Reputation: 172528

You can try this:

SELECT CONVERT(char(10), GetDate(), 126)

or in your case:

SELECT CONVERT(char(10), @DateIssued, 126)

You can look into CAST and CONVERT

Upvotes: 2

Related Questions