• Thom A - Saturday, February 25, 2017 11:25 AM

    I have to ask, but why are you storing your data like this? I don't think the problem is really the need to try and get data about datetimes from an nvarchar column, but that the system shouldn't be set up like this, period. I would be more concerned about fixing your database structure.

    You also stated that times are "typically" stored in that format. So they could be in different formats? Could you, instead, provide proper sample data which provides all the scenarios we should expect to encounter at least, in a format we can use (Insert statements), please. Without knowing every scenario we might encounter then a proposed answer may well not give you the desired output for all your eventualities.

    There's no 'instead' about the sample data - what I posted originally, is what exists.  I can give you more of the same, it but it will follow the same pattern, 5 rows of junk data followed by a date and time.  That isn't going to vary. 

    If you're saying I need to extract the datetime data and store it in a datetime column, I can make ANY changes necessary, and welcome suggestions detailing how to proceed.  It's why fora exist.