Viewing 15 posts - 1 through 15 (of 16 total)
deployed your function #3
create table #tmp (data float(50))
insert #tmp values(112.097)
select dbo.NewFormatFloat3(data,7) from #tmp
drop table #tmp
--112.0969999
So still altering digits.
Appreciate your zero-out code.
Jack
March 4, 2010 at 5:28 pm
After change function to use float(50) I got
select dbo.NewFormatFloat2(152.463616,13)
--152.464
some cutoff
Jack
March 4, 2010 at 3:09 pm
(1) I cannot change the column type. it is a vendor software and they should have used decimal(m,n)
(2) I change your function slightly, replacing decimal with Float. Still not fully...
March 4, 2010 at 3:06 pm
Ray-SQL,
Thanks for you code. Much simpler and I will try to incorporate.
I used your function on a temp table ( float(50) or float)
create table #tmp (data float(50))
insert #tmp values(112.097)
select dbo.NewFormatFloat(data,12)...
March 4, 2010 at 2:40 pm
As requested here is the code
CREATE FUNCTION [dbo].[FormatFloat](@dIn decimal(30,14),@p int)
RETURNS varchar(100)
AS
begin
if (@dIn is null) return null
declare @d decimal(30,14)
set @d=Round(@dIn,@p) --- Float precission is 15 digits
declare @intPart bigint
set...
March 4, 2010 at 9:38 am
Thanks for your opition.
Without converting to varchar(50), we can keep more than 7
declare @f decimal(38,20)
set @f=9999999.1234567890123456789012345678
select round(@f,20)
The key problem is about converting to varchar(50). I actually wrote a function...
March 4, 2010 at 9:05 am
Barry,
Thanks for you comments:
(1) I will try CTE, View and SQL 2008 Editor. Very good suggestions
(2) Re-engineering is not possible since it is a closed sysetm Crystall report. I can...
August 2, 2009 at 11:10 pm
Jeff,
I do read all your guys comments and it is now hard to quote now:
(1) I am dealing with Crystal report in a closed sysetm so cannot have my...
August 2, 2009 at 11:00 pm
Jeff (and I) was talking about Cursors and loops, not TVF's. ...there is no reason to believe that your only choices are cursor-based code or 1500-line procedures.
Barry,
For big block...
August 2, 2009 at 5:06 pm
How is that? There's nothing in what you've told us that would lead to that conclusion.
Barry,
I just finished writing all 10 user TVF in T-SQL. Another developer wrote similar...
July 29, 2009 at 8:12 pm
there should be no need for "procedural feature" nor a cursor to loop through rules no matter how complicated
Jeff,
In that sense, we will end up with a...
July 23, 2009 at 7:23 pm
Unless it has to do with effecient RegEx, I've not known that to be true. It would be interesting to try to solve your problem with a T-SQL only...
July 22, 2009 at 7:05 pm
Jonathan,
Thanks for the suggestions for reproducing the bugs. I will try it in the next few weeks.
Yes, I am trying to convert to T-SQL. If I have choice I would...
July 22, 2009 at 6:47 pm
This function is more or less like data mapping, not much...
July 21, 2009 at 11:52 pm
Hi All,
Thanks for your response.
Jonathan,
I have not figured out.
Jeff,
The CLR Function, exec select statement, using datareader to iterate through, return result set in a table. The assembly...
July 21, 2009 at 9:52 pm
Viewing 15 posts - 1 through 15 (of 16 total)