AnsweredAssumed Answered

SQL results include commas

Question asked by Stu412 on Jan 15, 2016
Latest reply on Jan 15, 2016 by alecgregory

Hi all,

 

Probably a simple one this, but I didn't expect it.  I'm testing some SQL code below, trying out the CASE statement as per FM advanced training guide.

 

ExecuteSQL ( "

 

SELECT Sum (CASE RowID WHEN 1 THEN \"Amount\" END) ,

       Sum (CASE RowID WHEN 2 THEN \"Amount\" END) ,

       Sum (CASE RowID WHEN 3 THEN \"Amount\" END)

 

FROM TestSQL_Static

WHERE RowID = ?";

 

"" ; "" ;

 

RowID

 

)

 

My results on a list report sorted by a sub summary part set on RowID for my own clarity shows a two commas at the right side of the first row's result, one either side of the second row's result and two before the third row's result.  I suspect it's something to do with the commas on the Sum statements, but removing them breaks the query.  Screenshot attached.

 

Any help gratefully appreciated.

 

Thanks

Attachments

Outcomes