我有一张桌子:
MTCN 编号 RecPrincipalAmount TotalCharges 123 APK123 506.21 258.22
现在我想添加RecPrincipalAmount
并将TotalCharges
它们插入到PrincipalAmount
.
我要这个:
MTCN 号码 PrincipalAmount 123 APK123 764.43
我想在 Crystal Reports 中显示所有这些数据。
我有一张桌子:
MTCN 编号 RecPrincipalAmount TotalCharges 123 APK123 506.21 258.22
现在我想添加RecPrincipalAmount
并将TotalCharges
它们插入到PrincipalAmount
.
我要这个:
MTCN 号码 PrincipalAmount 123 APK123 764.43
我想在 Crystal Reports 中显示所有这些数据。
select MTCN,
Number,
RecPrincipalAmount+TotalCharges as PrincipalAmount
from YourTable
您可以varchar
在float
添加之前将其转换为。
select MTCN,
Number,
cast(RecPrincipalAmount as float)+cast(TotalCharges as float) as PrincipalAmount
from YourTable
或者money
如果那更合适。
select MTCN,
Number,
cast(RecPrincipalAmount as money)+cast(TotalCharges as money) as PrincipalAmount
from YourTable
尝试使用这个。
SELECT
MTCN,
Number,
CONVERT(FLOAT, RecPrincipalAmount) + CONVERT(FLOAT, TotalCharges) PrincipalAmount
FROM TableName
使用公式字段:
//{@Principal}
{table.RecPrincipalAmount} + {table.TotalCharges}
SELECT SUM(RecPrincipalAmount + TotalCharges ) as "You Column"
FROM Your_Table;