troubleshooting Question

Converting date with a Z to format 101 format

Avatar of Fred
FredFlag for United States of America asked on
Microsoft SQL ServerSQL
5 Comments1 Solution27 ViewsLast Modified:
Imported excel table to sql server,  Dispatch_Date column shows as. Its data type is varchar(50) on SQL table. I am trying  to convert it to date column, 101 and a time column

2018-08-03T12:57:25Z
2018-08-03T14:58:15Z

I tried select convert(varchar(50),Dispatch_Date,101)  shows 2018-08-03T12:57:25Z,  
I tried select convert(datetime,'Dispatch_Date',101) throws error "Conversion failed when converting date and/or time from character string."
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros