Share via

SQL nvarchar to datetime

Li, Bin (Health) 0 Reputation points
2023-07-07T04:38:03.2833333+00:00

Hi I have a question regarding datatype nvarchar. In the table I use, a variable 'date of presentation' is nvarchar(4000), i have convert nvarchar to Britishformat using:

SELECT CONVERT(nvarchar(4000),[Date of Presentation],103) AS Britishformat

From data source

WHERE [Date of Presentation] >='01/03/2023'

Britishformat

20/08/2022

19/03/2023

13/10/2022

25/03/2023

25/01/2023

14/03/2023

But after I executed it, it seems something wrong, some records before the date have been shown below, not sure why??

Can someone help me? thank a lot.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Olaf Helper 47,616 Reputation points
    2023-07-07T05:29:23.9066667+00:00

    You posted the wanted output format, but more important is the format how the date values are stored; you didn't mentioned that.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.