Forum Replies Created

Viewing 15 posts - 1,771 through 1,785 (of 10,143 total)

  • RE: How to over come from outer apply

    drew.allen (2/5/2016)


    Hugo Kornelis (2/5/2016)


    ChrisM@Work (2/5/2016)


    ORDER BY MC.TerminationDate, MC.EffectiveDate DESC

    I didn't go over all your modifications, but this one just struck my eye.

    I think you intended this to be:

    ORDER BY MC.TerminationDate...

  • RE: How to over come from outer apply

    Hugo Kornelis (2/5/2016)


    ChrisM@Work (2/5/2016)


    ORDER BY MC.TerminationDate, MC.EffectiveDate DESC

    I didn't go over all your modifications, but this one just struck my eye.

    I think you intended this to be:

    ORDER BY MC.TerminationDate DESC,...

  • RE: How to over come from outer apply

    Some observations to add to SpaghettiDBA's comments:

    1.Remove any unnecessary tables from the FROM list. Begin with the two left-joined views. Since they are left joins, they cannot restrict the output,...

  • RE: How do I concatenate Month and Day to get date mm/dd format

    Luis Cazares (2/4/2016)


    Chris,

    Is there any particular reason for using 1900 + DATEDIFF(YEAR,0,GETDATE()) instead of YEAR(GETDATE()) ?

    No - thanks for pointing this out Luis. I was in the middle of building...

  • RE: How do I concatenate Month and Day to get date mm/dd format

    I agree with Luis, at least one of your columns is INT. Try this:

    SELECT *,

    CAST(

    CAST(x.ThisYear AS char(4)) +

    RIGHT('0'+CAST(Fiscal_Year_End_Month_Nbr AS varchar(2)),2) +

    RIGHT('0'+CAST(Fiscal_Year_End_Day_Nbr AS varchar(2)),2)

    AS datetime)

    FROM ( -- sample...

  • RE: How do I concatenate Month and Day to get date mm/dd format

    kkbear (2/4/2016)


    I want to concatenate month and day in two columns to get date format with mm/dd. So I use below script.

    CAST(b.Fiscal_Year_End_Month_Nbr + '/' + b.Fiscal_Year_End_Day_Nbr as datetime) as [Fiscal...

  • RE: Pivoting Problem

    Or using the hardcoded crosstab model, this - which I find much easier to manipulate than dynamic SQL.

    ;WITH ExtraGroup AS (

    SELECT LOB, Attribute, Value, grp = ROW_NUMBER() OVER (PARTITION...

  • RE: Select Statement retun records between 12:AM and 12:03 AM

    Try this filter:

    WHERE run_time BETWEEN 0 AND 300

  • RE: Are the posted questions getting worse?

    Stuart Davies (2/4/2016)


    BL0B_EATER (2/4/2016)


    ChrisM@Work (2/4/2016)


    Luis Cazares (2/3/2016)


    This got me by surprise. I'm not searching for jobs, but it got my attention because it was totally unexpected (but possibly logical).

    https://www.linkedin.com/jobs2/view/99695736

    Stuart's BS...

  • RE: Are the posted questions getting worse?

    Brandie Tarvin (2/4/2016)


    Stuart Davies (2/4/2016)


    BL0B_EATER (2/4/2016)


    ChrisM@Work (2/4/2016)


    Luis Cazares (2/3/2016)


    This got me by surprise. I'm not searching for jobs, but it got my attention because it was totally unexpected (but possibly...

  • RE: Computed Column Expression not working

    SteveD SQL (2/4/2016)


    Hi All,

    In most of my tables I have Active and Inactive columns as most of the time I can DELETE record I just need to 'inactivate' them.

    I was...

  • RE: Left Join to Temp Table Not Returning All Records

    Better still, write it in a way which is most likely to be performant as well as correct. It's very little extra work:

    -- SARGable Solution

    DECLARE @StartDate DATETIME = '20130101'; --...

  • RE: Are the posted questions getting worse?

    Luis Cazares (2/3/2016)


    This got me by surprise. I'm not searching for jobs, but it got my attention because it was totally unexpected (but possibly logical).

    https://www.linkedin.com/jobs2/view/99695736

    Stuart's BS guru would be a...

  • RE: Pivoting Problem

    silverbullettruck (2/3/2016)


    Here's the situation with the LOB = MNS. MNS has two different properties for the XLOB (ML and MS), for those two different XLOB values there are differing...

  • RE: Pivoting Problem

    J Livingston SQL (2/3/2016)


    ChrisM@Work (2/3/2016)


    silverbullettruck (2/3/2016)


    Yes, it would be ok to switch values for the values that exist multiple times for the same LOB with different values, but the values...

Viewing 15 posts - 1,771 through 1,785 (of 10,143 total)