Forum Replies Created

Viewing 15 posts - 196 through 210 (of 562 total)

  • RE: Month and Year Columns

    ZZartin - Thursday, January 19, 2017 2:22 PM

    What happens in January?

    It would be something more like, at least the month and year...

  • RE: Rewriting a slow subquery of a view

    Can you post the table sizes ?

    I do not understand the construction around Table_G.
    This looks 'nondeterministic' which could cause problems. The number of different results that this subquery...

  • RE: Database Diagram of Information_Schema.

    All thanks for your effords.

    But for a number of purposes I do prefer the information_schema. Especially when advising to college's.
    It is less comprehensive and therefore easier to...

  • RE: Select next appropriate record.

    akinwandeb - Monday, January 16, 2017 6:10 AM

    John Mitchell-245523 - Monday, January 16, 2017 5:55 AM

    Thanks,...

  • RE: The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

    smer - Friday, January 13, 2017 1:44 AM

    Hi Experts,

    While running the query on different months work fine but not running on 31-December-2016 ,please...

  • RE: How to write a string to a file in SQL.

    Thom A - Thursday, January 12, 2017 7:32 AM

    ben.brugman - Thursday, January 12, 2017 7:15 AM

  • RE: How to write a string to a file in SQL.

    Thom A - Tuesday, January 10, 2017 9:39 AM

    If you are using the SSIS Catalog to deploy your projects, then running them from...

  • RE: Overlapping datetime ranges.

    Sergiy - Tuesday, January 10, 2017 8:11 PM

    ben.brugman (1/6/2017)


    Jason A. Long (1/5/2017)If I'm understanding correctly, the objection is that the "obliterated" rows are...

  • RE: How to write a string to a file in SQL.

    Eirikur Eiriksson (1/10/2017)

    You will have to elaborate further on the requirements, UTF-8 is unicode hence multi byte!

    😎

    Oops, my bad, I want an 8 bit character set and not a 2...

  • RE: Overlapping datetime ranges.

    Jason A. Long (1/5/2017)

    If I'm understanding correctly, the objection is that the "obliterated" rows are displaying the "MaxPrevEnd" values in the NewBeg & NewEnd columns, rather than the original EndDate.

    Sorry,...

  • RE: Overlapping datetime ranges.

    --============================================================================

    -- The actual solution... (Based on the solution given by Jason A. Long, thanx).

    -- Adapted to the example.

    -- Corrected for : 1 Enddate does not change.

    --...

  • RE: Overlapping datetime ranges.

    Jason A. Long (12/22/2016)


    This should be a simpler & faster solution as it only takes a single pass over the data...

    -- Setup some test data...

    IF OBJECT_ID('tempdb..#TestData', 'U') IS NOT NULL...

  • RE: Overlapping datetime ranges.

    Jason A. Long (12/22/2016)


    Here's what the solution looks like laid out graphically in Excel (note: I change a few dates to compact the ranges...)

    Exactly what was asked, thank you.

    I am...

  • RE: Overlapping datetime ranges.

    Sergiy (12/22/2016)


    Can you post your TestTable definition?

    The testtable definition was in the post before my previous post.

    At the start of that code the text is : -- ...

  • RE: Overlapping datetime ranges.

    Sergiy (12/20/2016)


    Here is something to start with:

    SELECT ID, FromValue, ToValue

    INTO #Periods

    FROM (

    SELECT 1, 2.1, 8.0

    UNION

    SELECT 2, 3., 4.5

    UNION

    SELECT 3, 4., 10.

    UNION

    SELECT 4, 9., 20.

    ) I (ID, FromValue,...

Viewing 15 posts - 196 through 210 (of 562 total)