Forum Replies Created

Viewing 15 posts - 1,216 through 1,230 (of 6,036 total)

  • RE: Mortgage amortization table

    Solomon Rutzky (8/30/2016)


    . In order to help see this, I modified one of your examples to show that the "float" value multiplied by the "term" isn't the original "amount" that...

  • RE: Mortgage amortization table

    Jeff Moden (8/29/2016)


    Heh... let's hope the programmers in the IRS aren't using FLOAT to make decisions.

    You better hope they do.

    Why - see below.

    DECLARE @Amount MONEY, @Term INT

    DECLARE @fRate float, @dRate...

  • RE: Mortgage amortization table

    Jeff Moden (8/29/2016)


    Normally, though, I like the code to be at least as resolute as Granny's dollar store 4 function calculator and will use a scale of at least 15.

    Here...

  • RE: SQL Sever 2012 identity bug?

    If there would be the same identity generated an error would happen on insert to SESSION table.

    Because of a primary or unique key on the IDENTITY column in table SESSION....

  • RE: Union Date/Time Data Types

    pstanislav (8/26/2016)


    I agree with the comments here - the code as written will produce variable results as the separate GETDATE functions are evaluated. This can be avoided by getting...

  • RE: Log File is full when reindexing... but not

    That's pretty simple.

    During reindexing the log grows until it runs out of free space on the disk.

    Then it fails and stops.

    The backup job comes couple of hours later, cleans up...

  • RE: how to remove leading 1 and zeros

    dastagiri16 (8/27/2016)


    i am getting numbers like as below,

    1000000017777

    1000000017342

    how can i remove leading 1 and zeros (10000000) and get the result like 17777

    Just do what's requested:

    remove leading 1

    STUFF('1000000017777', 1,1,'')

    and zeros

    CONVERT(int, STUFF('1000000017777',...

  • RE: Mortgage amortization table

    To make it really painful:

    DECLARE @Amount MONEY, @Term INT

    DECLARE @fRate float, @dRate decimal (38,28)

    SELECT @Amount = 1000000, @Term = 17*3*13*7*19*23*43*11

    SELECT @fRate = CONVERT(FLOAT, @Amount)/@Term,

    @dRate = CONVERT(DECIMAL(38,28), @Amount)/@Term

    SELECT @fRate [@fRate], @fRate...

  • RE: Mortgage amortization table

    Jeff Moden (8/29/2016)


    Someone would have to prove that one to me, Sergiy.

    It took 2 minutes:

    DECLARE @Amount MONEY, @Term INT

    DECLARE @fRate float, @dRate decimal (38,10)

    SELECT @Amount = 1000000, @Term =...

  • RE: query to stop running when a specific value in a row. odd request.

    roy.tollison (8/29/2016)


    this gives me something to work with thanks...

    What do you want to work on?

    You've been given the solution.

    All you need to do is to translate it into SQL.

    EzipayEmailList

    1. "...

  • RE: Mortgage amortization table

    Jeff Moden (8/29/2016)


    vdiazh (8/28/2016)


    Is great, thanks

    I hope you're not using the FLOAT version. FLOAT is a binary "approximation" of numbers and it the scale varies according to how many...

  • RE: query to stop running when a specific value in a row. odd request.

    roy.tollison (8/28/2016)


    I am needing a way to query the table to only get all the rows until a 'B' type is found

    Assuming the order of rows is defined by auto-incremental...

  • RE: Executing dynamic functions in table select

    paulo.margarido (8/25/2016)


    ok, now can we go back to the discussion?

    Here is what solves your problem.

    SELECT h.Date

    FROM dbo.Holidays h

    WHERE Territory = @Territory

    AND Level = @Level

    AND Date >= DATEADD(YY, DATEDIFF(YY, 0,...

  • RE: Executing dynamic functions in table select

    ChrisM@Work (8/25/2016)


    Of course not. The function calculates US holidays because most users of ssc are in or from the US. I'm in the UK and I've written a similar function...

  • RE: Executing dynamic functions in table select

    ChrisM@Work (8/24/2016)


    paulo.margarido (8/24/2016)


    i'm aware of what "inline table-valued functions" are, i have a few of my own in the DB

    what i ask is how can i do it that way

    if...

Viewing 15 posts - 1,216 through 1,230 (of 6,036 total)