Updated: 27 August 2010
Use IMPRODUCT to return the product of a dataset containing complex numbers in x + yi or x + yj text format. The product of 2 complex numbers is computed as:
Syntax
SELECT [wctEngineering].[wct].[IMPRODUCT] (
   <@IMValues_Tablename, nvarchar(4000),>
 ,<@ColumnName, nvarchar(4000),>
 ,<@GroupedColumnName, nvarchar(4000),>
 ,<@GroupedColumnValue, sql_variant,>)
Arguments
@IMValues_Tablename
the name, as text, of the table or view that contains the complex numbers to be used in the IMPRODUCT calculation.
@ColumnName
the name, as text, of the column in the table or view specified by @IMValues_Tablename that contains the complex numbers to be used in the IMPRODUCT calculation.
@GroupedColumnName
the name, as text, of the column in the table or view specified by @IMValues_Tablename which will be used for grouping the results.
@GroupedColumnValue
the column value to do the grouping on.
Return Types
varchar(4000)
Remarks
·         Use COMPLEX to convert real and imaginary coefficients into a complex number.
·         For more complex queries consider using the IMPRODUCT_q function.
Examples
create table #p1 (inumber varchar(50))
insert into #p1 values ('2+i')
insert into #p1 values ('2-i')
insert into #p1 values ('3+2i')
insert into #p1 values ('3-2i')
select wct.improduct('#p1','inumber','',NULL)
This produces the following result
------------------------------
65
 
(1 row(s) affected) 
select wct.IMMULT(wct.IMMULT('2+i','2-i'), wct.IMMULT('3+2i','3-2i')) 
This produces the following result
------------------------------
65
 
(1 row(s) affected)