I have the following SQL statement that I'm attempting to split into columns:
select
count(rtnotes.keyno) as value,
ent.company as label,
'j-ChartDrillDown-406,'+CAST(ENT.ENTID AS CHAR(10)) AS link,
dateadd(week, datediff(wk, 0, dateadd(wk,-5,getdate())), -1) as test
...
I want this split into the 4 columns within the select statement:
count(rtnotes.keyno) as value
ent.company as label
'j-ChartDrillDown-406,'+CAST(ENT.ENTID AS CHAR(10)) AS link
dateadd(week, datediff(wk, 0, dateadd(wk,-5,getdate())), -1) as test
I have been able to split by commas not within quotes using:
,(?=(?:[^']*'[^']*')*[^']*$)
but I also need to ignore commas within parenthesis (nested parenthesis in this case due to dateadd and datediff)