Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 1,419 total)

  • Reply To: Help in Date spans for continuoes and regular dates spans

    The query could be without the cte

    select
    t1.id, cast(t1.startdate as date) startdate, cast(t1.enddate as date) enddate, cast(td.enddate as date) range_end_dt
    from
    dbo.test_1 t1
    cross apply
    ...

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

  • Reply To: Help in Date spans for continuoes and regular dates spans

    The OP wrote: "output is expected as if member is continuously enrolled without any gap in enrollment get min and max and if there is enrollment gap leave as is." ...

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

  • Reply To: Help in Date spans for continuoes and regular dates spans

    To resolve for arbitrary relationships in the data requires hierarchical recursion, no?  The OP's question and Phil's too

    drop table if exists dbo.test_1;
    go
    create table dbo.test_1(id int,startdate datetime ,enddate...

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

  • Reply To: Sum query

    drop table if exists dbo.test_T1;
    go
    create table dbo.test_T1(
    ID1 varchar(8) not null,
    ID2 varchar(8)...

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

  • Reply To: UTC time to EST time

    In 2016 there are some nice built in features to support time zone conversions

    /* the list of time zones your instance supports */
    select * from sys.time_zone_info;

    declare
    ...

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

  • Reply To: Query

    this

    declare @frDate         date='2020-03-31';

    with a_cte(DocType, Debit, Credit, Account, Mdate) as
    (select 'TC', 10, 20, 123, '2020-03-30'
    ...

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

  • Reply To: Query

    Phil Parkin wrote:

    In this i want to add condition if @frdate Month = 3 and Date = 31 ...

    That's what the OP wrote but is it what they meant?  🙂  Idk

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

  • Reply To: Query

    Phil Parkin wrote:

    Try adding this to your WHERE clause:

          AND NOT (
    ...

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

  • Reply To: Merge not updating in explicit transaction

    As separate statements maybe something like this

    set xact_abort on;

    begin transaction;
    begin try
    update g
    set
    [skuId] =...

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

  • Reply To: EF Code-First

    bbsimonbb wrote:

    Some code to look at?

    JsonAutoService

    bbsimonbb wrote:

    And what does this sentence mean... "It isn't (and wasn't) possible to access the request route values from within the program delegate." ?...

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

  • Reply To: EF Code-First

    Ok Jeff, I'll do whatever you suggest.  I'll submit something.

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

  • Reply To: EF Code-First

    bbsimonbb wrote:

    I'm intrigued, but I have absolutely no idea what this looks like in practice. Have you got a friendly introduction somewhere? Video? Some code to look at? And what...

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

  • Reply To: Are there application developers in here? Where are you doing your SQL?

    It's an interesting approach.  I've cloned the repo.  Two things I like based on initial impression are the intellisense on db objects and the C# unit test codegen.

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

  • Reply To: The IDENTITY Column Property

    It's great to see this article!  I'm going to sit this pie fight out though.  Two items I would toss in fwiw:

    1. The return type of the SCOPE_IDENTITY function is...

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

  • Reply To: calc/group data by week for date range ?

    Nicely done!  It looks cleaned up now

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

Viewing 15 posts - 1,006 through 1,020 (of 1,419 total)