Last post Jan 13, 2012 01:01 AM by ssjGanesh
Jan 12, 2012 06:55 AM|rpk2006|LINK
My report is connected to a stored procedure. In Field Explorer there is an integer column which is not insert on the report but it is used as a query string parameter when a hyperlinked field is clicked on the report.
This integer field, RecNo, is coming to Field Explorer in the format: #,###. I don't want to use comma and want to use a number like: ####.
How to truncate comma?
Jan 12, 2012 08:21 AM|ssjGanesh|LINK
After u got like,
U just split them by ,(Delimiter) then it stored like,
Then u can concatenate like, arr+arr
it produce #####
Jan 12, 2012 11:31 PM|rpk2006|LINK
Is there any truncate option to replace comma with blank and than Trim the text?
Jan 13, 2012 01:01 AM|ssjGanesh|LINK
As of my knowledge split() is a best way coz in future if u have the same problem with any other special characters like,
,,!,@,#,$,%,^.,<, u can use the same function to remove it,
Here is the Table valued function i have used.
USE [dbWeServe]GO/****** Object: UserDefinedFunction [dbo].[FN_splitID] Script Date: 01/12/2012 21:57:47 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO-- =============================================-- Author: Ganesh.S-- Create date: 31st Dec.,-- Description: For spliting the memberId and insert into tblAttendance -- =============================================-- select * from FN_splitID('3,5,8',',')
CREATE FUNCTION [dbo].[FN_splitID](@NonSplited nvarchar(MAX) , @Delimiter char(1))RETURNS @temptable TABLE (ReferenceId1 nvarchar(50) not null ) ASBEGIN declare @idx int declare @Splited varchar(8000) select @idx = 1 if len(@NonSplited)<1 or @NonSplited is null return while @idx!= 0 begin set @idx = charindex(@Delimiter,@NonSplited) if @idx!=0 set @Splited= left(@NonSplited,@idx - 1) else set @Splited = @NonSplited if(len(@Splited)>0) insert into @temptable(ReferenceId1) values(@Splited) set @NonSplited = right(@NonSplited,len(@NonSplited) - @idx) if len(@NonSplited) = 0 break end RETURN ENDGO