Share via

SQL Server, DATEPART Function ERROR : 'Msg 241, Level 16'

Anonymous
2017-08-12T21:46:24+00:00

I'm trying the DATEPART function to retrieve the day of the week eg: Monday, Tuesday etc... 

I've used this query:

SELECT [Date],DATEPART(DW,[Date]) FROM [dbo].[RoadAccidents_2014]

The '[Date]' column is stored as a varchar(50),null string and is in the date format below:

09/01/2014

20/01/2014

21/01/2014

15/01/2014

09/01/2014

17/01/2014

10/01/2014

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2017-08-12T21:50:16+00:00

    In addition SQL Server is returning the error message:'

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

    Was this answer helpful?

    0 comments No comments