Convert string to number field

2019-04-22 04:46发布

I have a Database field whose datatype is String in Crystal Reports. How can I convert it to a number value?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-04-22 05:27

Within Crystal, you can do it by creating a formula that uses the ToNumber function. It might be a good idea to code for the possibility that the field might include non-numeric data - like so:

If NumericText ({field}) then ToNumber ({field}) else 0

Alternatively, you might find it easier to convert the field's datatype within the query used in the report.

查看更多
登录 后发表回答