Forum Replies Created

Viewing 15 posts - 526 through 540 (of 1,419 total)

  • Reply To: Splitting one wide column into serveral different ones

    Yeah situations like this happen all the time tho.  It seems there are unmodeled relationships in the data.  Also, right away I would try to find out if you're supposed...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Grouping , time difference in minutes

    Hi there.  Using BETWEEN and DATETIME is really not recommended.  Jeff pointed this out and I listened but didn't change the code.  Suspicious things 1) the datetime range doesn't seem...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How can I compare two HL7-like text files?

    Hi Rod, cheers.  Not sure about pro tools but if you're up for rolling your own you could try .NET and System.IO

    https://docs.microsoft.com/en-us/troubleshoot/dotnet/csharp/create-file-compare

    https://stackoverflow.com/questions/1358510/how-to-compare-2-files-fast-using-net

     

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: How to solve this

    It's a school assignment?  There are seemingly quite a few steps to accomplish.  What's the question?

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Best practice to store - How many days, minute and second ?

    How to plan data types?  It's simple: use the minimum necessary size given your anticipated precision requirements.  Aside: there are edge cases having to do with all sorts of exceptions...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    Great insights as always Jeff.  Ha, yes I do remember those days.  No spring chicken here.  The first number in my age is a 5.

    3 ways to convert an integer...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    A numbers splitter is a really nice solution.  I thought the question was already answered.  What else could be done with a numbers splitter?

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    Why not get rid of FLOAT as soon as possible by CAST'ing POWER to BIGINT ?

    select NumericValue, conv_bigint.num
    from #IntChange ic
    cross apply (select...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: OK, I still think like a programmer -- is there a better way to do this?

    Here's an attempt to refactor the query with functional equivalency (afaik)

    insert into [Micros].[UserTerminations]([UserID], [TerminationDateTime])
    select u.[HostUserId], getdate()
    from [Micros].[Users] AS u
    where exists (select 1
    ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Conditional Trailing Totals

    Ok when you explode the lines the Demand is being split up to correspond incrementally to the date.  However, when expanded the OnHand and NextJobQty are being replicated in full. ...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Calculate number of times a number can be split evenly into pre-defined groups

    It's algebra which could be directly calculated, no?

    1555201/2^x=800

    2^x=1555201/800

    log10(2^x)=log10(1555201/800)

    x = log10(1555201/800) / log10(2)

    x=10.92481343

    The number of times it would need to be "applied" before it crossed the 800 barrier would be the...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Conditional Trailing Totals

    ross.hughes wrote:

    I am working on a job shortage report that first consumes inventory and then works through job supply one job at a time.  The query is using sum over...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    What about those flying cars?  Your code converts the 'NumericValue' column into VARCHAR(10) which is only ok as long as the integer is positive.  My code converted to VARCHAR(20) because...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    ScottPletcher wrote:

    What about a potential negative sign?  You gonna add a phony replacement in for that too?

    Good idea!  Yes, I added ('-', '-') and it works with negative integers now...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Reply To: Replace Numbers

    To review, the table definition provided by the OP

    CREATE TABLE dbo.IntChange (NumericValue INT)

    INSERT INTO dbo.IntChange
    VALUES (15697)
    ,(876)
    ,(1452)
    ,(3374)
    ,(894)
    ,(84516)

    You have some reason to believe the future universe of possible inputs...

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

Viewing 15 posts - 526 through 540 (of 1,419 total)