Convert string to number field

心不动则不痛 提交于 2019-12-22 04:05:55

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/7953435/convert-string-to-number-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!