Apologies in advance but I have searched the net and this site for an answer but I just can't seem to find it. I've tried
I have a column called RecurrencePatternXml with xml in it as shown in the example below which has different data in it and can change frequently.
<Recurrence StartDate="2015-03-10T00:00:00+00:00"><Weekly><Pattern Count="1"><Day>friday</Day></Pattern></Weekly></Recurrence>
<Recurrence StartDate="2015-04-01T00:00:00+01:00"><Weekly><Pattern Count="1"><Day>tuesday</Day><Day>thursday</Day><Day>sunday</Day></Pattern></Weekly></Recurrence>
<Recurrence StartDate="2015-04-27T00:00:00+01:00"><None /></Recurrence>
<Recurrence StartDate="2015-03-10T00:00:00+00:00"><Daily FrequencyPerDay="2"><Pattern><DayPattern Value="1" /></Pattern></Daily></Recurrence>
<Recurrence StartDate="2015-10-02T00:00:00+01:00"><Weekly><Pattern Count="2"><Day>monday</Day><Day>wednesday</Day><Day>friday</Day><Day>sunday</Day></Pattern></Weekly></Recurrence>
I'm trying to write a query that will show all of the individual data in individual columns and be null where there is no data.
Using the data below
<Recurrence StartDate="2015-11-12T00:00:00+00:00"><Weekly FrequencyPerDay="2"><Pattern count="1"><Day>tuesday</Day><Day>thursday</Day><Day>saturday</Day><Day>sunday</Day></Pattern></Weekly></Recurrence>
<Recurrence StartDate="2015-03-10T00:00:00+00:00"><Daily FrequencyPerDay="2"><Pattern><DayPattern Value="1" /></Pattern></Daily></Recurrence>
This would be the output I would expect.
Recurrence Weekly Daily Pattern Daypattern Day1 Day2 Day3 Day 4 Day5 Day6 Day7
2015-11-12 2 NULL 1 NULL NULL tuesday NULL thursday NULL saturday sunday
2015-03-10 NULL 2 NULL 1 NULL NULL NULL NULL NULL NULL NULL