Forum Replies Created

Viewing 15 posts - 631 through 645 (of 1,419 total)

  • Reply To: Find gaps in string values within a table

    Similar to Jeffrey's answer

    with lead_cte as (
    select *, lead(begnum) over (partition by Prefix order by begnum) lead_bn
    from #temp_docs)
    select concat(lc.Prefix,...

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

  • Reply To: Having a hard time with time zones

    You could try it like this

    DECLARE @CallDateTime DATETIME = '20190331 00:08:13'
    DECLARE @Duration NVARCHAR(25) = '01:18:04'

    declare @t datetime=@duration;
    select @t+@CallDateTime...

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

  • Reply To: SCUD?

    It could be CRUD but only when implemented by Scrum.  Or maybe it's a framework which launches projects miles over the horizon where they explode.

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

  • Reply To: How to get total only for today's date for some columns in reslut set

    You could try putting CASE logic inside the SUM functions to evaluate your youdatecol

    ...
    ISNULL(SUM(case when youdatecol>=convert(date, getdate())
    ...

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

  • Reply To: Split column values to multiple rows

    ;with
    id_split_person_cte(id, [Owner], ItemNumber, [PersonAttending]) as (
    select sctr.id, sctr.[Owner], splt_person.ItemNumber, splt_person.Item
    from #SplitColumnsToRows sctr
    ...

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

  • Reply To: Split column values to multiple rows

    Got any more examples?  It appears there are 2 sets of rules for the 2 different scenarios:

    Scenario 1) Owner='' -----> (if [Owner]='' then PersonAttending and Type columns are CROSS JOIN'ed)

    Scenario...

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

  • Reply To: Split column values to multiple rows

    It seems the data is ordinally JOIN'ed between PersonAttending and Type and CROSS JOIN'ed between PersonAttending and Owner.  To do the ordinal splitting this uses dbo.DelimitedSplit8K_LEAD.  Ordinal splitters and specifically...

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

  • Reply To: Split String into columns

    Similar to the accepted solution but without the common table expression.  It appears Jeff began to code it one way and then switched

    select max(case when sp2.ItemNumber=1 then...

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

  • Reply To: Get total no of minutes by hour hand between two dates

    The additional rows were generated using dbo.fnTally

    select case when fn.n=0 then k.CDMLOCID else '"' end CDMLOCID,
    case when fn.n=0 then...

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

  • Reply To: Multiple deadlocks occuring on simultaneous deletions from temporal table

    Hmmm it's hard to be certain without testing.   I've had issues with inserts of multiple rows with the same system datetime into System Versioned tables.  It's the "simultaneous" part it...

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

  • Reply To: Help with Boolean check box combinations

    If I'm understanding this could this be done in the WHERE clause with a bunch of OR conditions.

    select * 
    From Master as pom
    WHERE Pom.UserID = @userid
    ...

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

  • Reply To: what condition case when related to portion key mean ?

    Have a look at the Docs for SUBSTRING

    SUBSTRING ( expression ,start , length )

    When the CASE statement is evaluated as TRUE, because you're adding +1 to the length LEN...

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

  • Reply To: Forum Api Project

    Yes the repository is the better place for the code.  There are going to be many changes and now this thread seems incomplete.  Maybe it makes sense to start over...

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

  • Reply To: Forum Api Project

    Hi Steve Jones, when these posts were consolidated from what were originally 7 separate threads it appears a post(s)? containing the DDL and explanation for having a System Version'ed edition...

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

  • Reply To: Forum Api Project

    It's been a few weeks since there's been an update.  We've had some work upheaval and also my son's 6th Birthday party and the Memorial Day holiday.  Workwise I've been...

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

Viewing 15 posts - 631 through 645 (of 1,419 total)