You can translate the question and the replies:

to_char equivalent

Hi i want to acheive below in denodo. TO_CHAR(1210.73, '9999.9') Result: ' 1210.7' Where '9999.9' is value coming from my_table column name "format" and 1210.73 is value of my_table column name "o_ips" so basically it is select to_char(o_ips,format) as formated_Value from my_table; How can we do that in denodo since "cast" cannot format it like this one. Regards Salman
user
22-12-2020 03:57:26 -0500

1 Answer

Hi, In order to achieve the closeness to this requirement, I was able to use the CAST function to display one value after the decimal point. Here is my example. 7 in the following represents the number of valid digits and 1 is the number after the decimal point. CAST(o_ips, AS DECIMAL(7, 1)) Furthermore, if that’s your requirement, you can convert the result from numeric value to string by using CAST over it. I found this info in the following manual. This should be helpful to you. ・Type Conversion Function [CAST](https://community.denodo.com/docs/html/browse/8.0/vdp/vql/appendix/syntax_of_condition_functions/type_conversion_functions#cast) Hope this helps!
Denodo Team
23-12-2020 02:30:50 -0500
You must sign in to add an answer. If you do not have an account, you can register here