水晶公式将时间乘以成本

时间:2013-03-11 16:47:57

标签: crystal-reports

我需要一个能够乘以{table.time} * {table.cost}的公式。 这是我试过的:     tonumber({@timeformat})* {Table.cost}

Formula for {@timeformat}
whileprintingrecords;

numberVar hrs;
numberVar min;
stringVar hhmm;

hrs := Remainder(Truncate({table.time}/60),60);
min := Remainder({table.time},60);

hhmm := totext(hrs,"00") + ":" + totext(min,"00"); 


hhmm

当我这样做时,我在运行报告时遇到Crystal的字符串错误。 字符串是非数字的。 任何帮助是极大的赞赏。

谢谢

1 个答案:

答案 0 :(得分:0)

您的函数{@timeformat}生成的字符串看起来像02:30。它们对于可读性很有用,但它们不是数字,也不能将它们相乘。

相反,请尝试:

{table.time} * {table.cost}