on 09-30-2014 2:02 PM
Hi Experts,
I'm using CR XIR2. I have a Number data type column. I'm creating parameter based on that. Now when I pointed that column to the parameter I'm getting thousand separator in the number while entering the prompt. How to remove the separator?
Thanks,
Samrat Muddasani
Hi Samrat,
The only workaround is to convert the prompt to string and convert it back to number if you're refering to it in the record selection formula.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What kind of a parameter is it - static or dynamic?
With a dynamic prompt you'd need to use a command object (Don't join this to the existing tables) that uses a datatype conversion function. Something like:
select cast(number_column as varchar(10)) from table
You can then point the dynamic prompt to this field in the command object and use a record selection formula as"
totext({original_number_field}) = {?Prompt}
P.S: To improve performance, you can also use a SQL Expression Field to convert the number field to text so that you can use it in the selection formula.
-Abhilash
Here's what you need to do:
1) Change the prompt type to Static
2) Change the record selection formula to:
totext({original_number_field}) = {?String_Prompt}
Like I said above, CR does not pass datatype conversions back to the database and hence you won't see this filter as part of the where clause (if you're reporting directly against tables), thereby slowing down the report.
You would be better off creating a SQL Expression Field that uses database specific functions to convert the column to string and use this SQL Expression Field in the record selection formula.
-Abhilash
You don't need the 'select' part as Dell suggests.
cast("XFDP_WORK_VW"."WRK_RQST_NBR" as varchar(10))
should work, or Dell's function should work with a small modification too:
To_Char("XFDP_WORK_VW"."WRK_RQST_NBR")
You cannot use the curly braces CR puts around fields in a SQL Expression.
-Abhilash
Hi Abhilash,
Thanks for your response. You are always been a star for me.
cast("XFDP_WORK_VW"."WRK_RQST_NBR" as varchar(10)) has worked.
Dell,
Thanks a ton for your response too.
To_Char("XFDP_WORK_VW"."WRK_RQST_NBR") has not given the output which I was looking for.
Thanks a lot to all again,
Samrat Muddasani
Hi Samrat,
I think you are creating a static number type parameter so, while accepting input it is showing the number with thousand separator.
You can change the data type of your parameter to string and while comparing you have to convert to number and can compare this will solve the issue.
or
You write a SQL(Add Command) and convert number filed to string, this will solve the issue.
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.