question

anandgu avatar image
anandgu asked

I have to replace this date 12/28/15 **

I have to remove the ** and have to replace the date can anyone write syntax or query..
sql-server-2008sql-server-2012convertdatescast-convert
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

You have some good answers below. This web site runs by you voting and marking the best answers. For each helpful answer below, indicate this by clicking on the thumbs up symbol next to those answers. If any one answer lead to a solution, indicate this by clicking on the check mark next to that answer. This helps indicate your solution for anyone else with the same question.
0 Likes 0 ·
Gazz avatar image
Gazz answered
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

GPO avatar image
GPO answered
It might be better to take a bit of time and formulate a question that describes the underlying problem. For example "I have been given a text file that contains dates in various unpredictable formats and I have been asked to convert them into dates that SQL Server can understand. Here are some examples..." Anyhoo, for this specific post, try this: print convert(date,replace('12/28/15 **',' **',''), 1)
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.