Hello,
I'm trying to write a function that will output 10 characters and remove the decimal.
CREATE FUNCTION dbo.fnRemoveDecRate(@Rate VARCHAR(20))
RETURNS CHAR(10)
AS
BEGIN
RETURN
RIGHT(REPLICATE('0',10) + @Rate, 10)
CASE CHARINDEX(@Rate,char(46),1)
WHEN 0 THEN REPLACE(@Rate,CHARINDEX(@Rate,char(46)),'')
END
END
For the life of me, I cannot reconcile the VBA Instr return value with T-SQL's CharIndex()
Many Thanks.............
I'm trying to write a function that will output 10 characters and remove the decimal.
CREATE FUNCTION dbo.fnRemoveDecRate(@Rate VARCHAR(20))
RETURNS CHAR(10)
AS
BEGIN
RETURN
RIGHT(REPLICATE('0',10) + @Rate, 10)
CASE CHARINDEX(@Rate,char(46),1)
WHEN 0 THEN REPLACE(@Rate,CHARINDEX(@Rate,char(46)),'')
END
END
For the life of me, I cannot reconcile the VBA Instr return value with T-SQL's CharIndex()
Many Thanks.............