H
Harry
Hello,
I'm calling the DataTable.Compute(string expression, string filter)
public method to perform simple mean, min, max, etc. computations.
However the data stored in this table, let say people's ages, is of
type nvarchar/string and I need these computations to be performed as
if their type was integer this way the aggregate functions perform the
computations numerically and not lexically. Further, I can't change
the database schema so I have to deal with the conflicting types. The
obvious solution is to convert the column that holds this age data
from nvarchar to Int32, but how do I go about doing this from within
the DataTable.Compute method? Is this even possible or do I have to
create a new column in the table of type Int32 and set it's expression
to the value of this data column I'm interested in and wrap it in a
Convert function and then call the aggregate functions on this new
column?
Thanks in advance,
- Harry
I'm calling the DataTable.Compute(string expression, string filter)
public method to perform simple mean, min, max, etc. computations.
However the data stored in this table, let say people's ages, is of
type nvarchar/string and I need these computations to be performed as
if their type was integer this way the aggregate functions perform the
computations numerically and not lexically. Further, I can't change
the database schema so I have to deal with the conflicting types. The
obvious solution is to convert the column that holds this age data
from nvarchar to Int32, but how do I go about doing this from within
the DataTable.Compute method? Is this even possible or do I have to
create a new column in the table of type Int32 and set it's expression
to the value of this data column I'm interested in and wrap it in a
Convert function and then call the aggregate functions on this new
column?
Thanks in advance,
- Harry