I have data in a field that I need to split into separate fields. Fortunately the data is comma separated. The data looks like the following:
SQL
$206.00,$196.00,10/25/2016
I need the data split into three fields. I'm currently doing the following, which seems to work:
SQL
right(left(r.text,charindex(',',r.text)-2),len(left(r.text,charindex(',',r.text)-2))-1)amount,right(left(substring(r.text,charindex(',',r.text)+3,len(r.text)),charindex(',',substring(r.text,charindex(',',r.text)+3,len(r.text)))-2),len(left(substring(r.text,charindex(',',r.text)+3,len(r.text)),charindex(',',substring(r.text,charindex(',',r.text)+3,len(r.text)))-2)))amount_w_reduction,convert(varchar(8),convert(date,left(right(r.text,charindex(',',r.text)+1),len(right(r.text,charindex(',',r.text)+1))),101),1)enddue_date
However, I'm...