aman6496
aman6496

Reputation: 153

converting string format to date format

I am not able to convert the string to DATE format

select CONVERT(DATE, '8/17/2016', 103) 

Conversion failed when converting date and/or time from character string.

what can we do to resolve this thanks

Upvotes: 0

Views: 99

Answers (4)

Tharunkumar Reddy
Tharunkumar Reddy

Reputation: 2813

You can try with cast also

  select cast( '8/17/2016' as date) 

Upvotes: 1

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

Reputation: 93704

Actually you don't need that style, It is the one causing the error. Just CAST/CONVERT it to date. Try this

select CONVERT(DATE, '8/17/2016') 

Upvotes: 1

Chanukya
Chanukya

Reputation: 5893

SELECT convert(datetime, '8/17/2016', 111)

Upvotes: 0

Mansoor
Mansoor

Reputation: 4192

SELECT CONVERT(DATE, '8/17/2016', 101) 

Upvotes: 0

Related Questions