split function how to?

Answered split function how to?

  • Thursday, November 22, 2012 2:28 PM
     
     

    Hi All

     In a table I have been asked to present in a web form there is a text column that looks like below;

    Date of MDT: 23/04/2012

    Plan: MDT suggests that the AVM is embolisable fully.  Mr ffff to speak to the referring surgeon.

    Present: hfghfhghhg tyeryeryeryteryeyyryer

    Date of MDT: 09/07/2012

    Plan:  2cm right parietal nidus, sheffield opinion SRS was not thought to be appropriate due to the high flow and venous hypertension.  Patient is on the list to be embolised.

    Present: ththhth tytyyytytytyyt

    Date of MDT: 29/10/12

    Plan: Patient is to have another discussionin MDT after post op protocol 6 month CTA.

    Present: jgghghghh ytytyytyyty

    I basically need a new column every time ‘Date of MDT’ is entered, in excel I’d just use the text to columns feature but as I need this as an automated process could do with doing it in sql.  Have you any idea? I am quite new to t-sql so havent really followed several walkthroughs on how to split these columns, the Date of MDT can appear anywhere in the column and a new column needs to start each time, some times it appears several times other none;

    Thanks to anyone who can help;

    Cheers

All Replies