I've having some trouble with an Output Set Element and can't figure out why it's returning the error Incorrect syntax near the keyword 'Where'.I'm trying to create an output that concatenates a string of n=[FirstName]&d=[SUMDonationAmount]This is what I have:data_select 'n=' + b.fname + '&d=' + sum(a.cont_amt)data_from (SELECT DISTINCT b.customer_no, b.fname, a.* FROM vs_contribution a JOIN t_customer b on a.customer_no = b.customer_no)data_where a.cont_dt > dateadd(yy, -1, getdate())Can anyone see where I'm going wrong?Thanks in advance,Adriana LawSydney Opera House
Hi Adrianna,
1. have a.cont_amt instead of a.* ;2. when you use sum(cont_amt) , it must be "group by" clause, so have your SQL statement concluded by "group by fname"
Simon
Thanks all for your help on this - I had a chance to return to it last night and all is now well.Data select 'n=' + x.fname + '&d=' + cast(sum(x.cont_amt) as varchar(10))Data from (SELECT distinct b.fname, a.* FROM vs_contribution a JOIN t_customer b on a.customer_no = b.customer_no) xData where x.cont_dt > dateadd(yy, -1, getdate()) group by x.fnameAdriana