Forum Replies Created

Viewing 15 posts - 736 through 750 (of 1,413 total)

  • Reply To: Cursor and Subtraction Assignment Logic Issue

    To the OP it makes clear sense no doubt.  In this case the OP says they have part of the solution but only offer pictures of the problem.  Maybe we...

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

  • Reply To: Data between 2 dates (different years)

    It seems dfp(start_dt) should've been dfp(dt) in two places.   This is a really slow way to debug 🙂

    with
    dt_cte(dt) as (
    select dateadd(month, fn.n, dfp.start_dt)
    ...

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

  • Reply To: Data between 2 dates (different years)

    dfp(start_dt) is (or was intended to be) the alias (with column label) for the object defined by the VALUES table value constructor.  It appears there some were missing parentheses in...

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

  • Reply To: Sequencing query

    By "regroup"  does it mean "round and expand"?  Otherwise, how to handle the decimal precision?  To create 1 foot increments based on rounded ranges you could use a tally...

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

  • Reply To: Data between 2 dates (different years)

    ktflash, afaik it's almost a correct "quick fix".  TBL1 is a recursive CTE which generates a sequence of months (1 to 12).  Presumably this date range is to be adjusted...

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

  • Reply To: A Simple Formula to Calculate the ISO Week Number

    SwePeso wrote:

    DATEPART(ISO_WEEK, @thedate) ???

    Afaik this helps going in the other direction, from @thedate to iso week.  What about iso week, iso month, iso year to calendar date?

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

  • Reply To: A Simple Formula to Calculate the ISO Week Number

    Jeff Moden wrote:

    Thanks.  I'll look at it in a bit more detail later but my first impression is that the following line of code in the CROSSAPPLY is incorrect.

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

  • Reply To: A Simple Formula to Calculate the ISO Week Number

    Jeff Moden wrote:

    Steve Collins wrote:

    Is this still the best way to do this in 2021?  Google landed me at another SSC Forum from 2005, which I can't find anymore, and now I'm...

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

  • Reply To: A Simple Formula to Calculate the ISO Week Number

    Is this still the best way to do this in 2021?  Google landed me at another SSC Forum from 2005, which I can't find anymore, and now I'm using this

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

  • Reply To: Query is not giving me expected output.

    This seems to return output similar to the picture.  Is it just missing a total row?  What's not working?

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

  • Reply To: selecting columns based on condition

    You could unpivot both tables and inner JOIN them.  Here's an example based on another forum question/answer.  Something like this

    drop table if exists #tTableA
    go
    create table #tTableA(
    ...

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

  • Reply To: Are the posted questions getting worse?

    Steve Jones - SSC Editor wrote:

    It was very quick, and I knew about it yesterday, but didn't really do much other than give a vote to try. Still amazed it happened.

    Comments, suggestions, feedback on...

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

  • Reply To: Wrap your SQL into HTTP REST endpoints automagically ^_^

    polterguy wrote:

    The queries ends up wrapping a DataReader in .Net 5, which although technically are created to handle SELECT statements better, still works perfectly for also INSERT/UPDATE/DELETE statements, but you...

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

  • Reply To: Wrap your SQL into HTTP REST endpoints automagically ^_^

    It's an interesting approach.  There are a few questions that jump out tho.  There's no mention of how DML statements like INSERT/UPDATE/DELETE are handled?   Could it execute stored procedures?  How...

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

  • Reply To: Is there anything equivalent to a Last() Function

    drew.allen wrote:

    You know that the LAST_VALUE() is NEVER going to be before the CURRENT ROW, so it's completely unnecessary to specify the beginning of the window as UNBOUNDED PRECEDING when...

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

  • Viewing 15 posts - 736 through 750 (of 1,413 total)