Forum Replies Created

Viewing 15 posts - 946 through 960 (of 4,085 total)

  • RE: Point the null value in MAX to MIN of Next Date

    it.blr - Tuesday, September 4, 2018 11:24 PM

    Drew

    We have not configured any shift timing, we are simply assuming that the MIN value...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Generate a unique number for a record

    kadampatil.bk - Wednesday, September 5, 2018 5:34 AM

    Try This...
      SELECT 'AB99'+CAST(RIGHT('00000000' + CAST(ABS(CHECKSUM(NEWID())) % 99999999 AS VARCHAR(8)), 8) AS VARCHAR)...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    don.hughesjr - Tuesday, September 4, 2018 12:27 PM

    The query I used was the following

    SELECT c.value('(ParameterValue[Name ="TO"]/Value/Text())[1]', 'nvarchar(max)') AS Emailreceipt, c.value('(ParameterValue[Name ="CC"]/Value/Text())[1]', 'nvarchar(max)')...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Dynamically pivot a table

    People are much more inclined to help if they see that you've actually attempted this yourself.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    don.hughesjr - Tuesday, September 4, 2018 10:42 AM

    Drew,

    I did try it your way and I'm getting an error...

    XQuery [@sample.field.value()]: The XQuery...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: When is too many columns too many columns?

    Kevlarmpowered - Tuesday, September 4, 2018 6:37 AM

    I came across this link and I was curious what this group said about that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: how can I have a failed job notification be emailed to more than one person

    The best way is to mail it to an email distribution list, which will then email it to the appropriate people.  It's usually much easier to adjust a distribution list than...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    Sergiy - Tuesday, September 4, 2018 7:54 AM

    Like this?

    DECLARE @sample TABLE (field XML)
    INSERT @sample
    VALUES('<ParameterValues><ParameterValue><Name>prmExpandState</Name><Value>Collapse</Value></ParameterValue><ParameterValue><Name>AKDunsNumber</Name><Value>146159</Value></ParameterValue></ParameterValues>')

    SELECT c.value('Value[1]', 'int') AS AKDunsNumber, d.value('Value[1]', 'varchar(50)') AS...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Point the null value in MAX to MIN of Next Date

    The problem is that you are grouping on the DATE instead of the shift.  Without sample data, it's hard to tell you how to go about grouping by the shift...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    don.hughesjr - Tuesday, September 4, 2018 6:03 AM

    Yes I do understand that the sample data only had one value. for AKDunsNumber. There...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Why do people have such trouble understanding the relationship between sample data and expected results.  The expected results should have more than a tenuous relationship to the sample data.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    Well you didn't set up your sample data in a table, so I did that for you.  Also, there is no way that you are deriving those expected results from...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to get a multiple select to populate into a temp table?

    If the data is formatted in XML why aren't you using xquery?

    You also want to look into using a table value constructor.  If you post sample data and...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Case statement with multiple values returned

    This is also not the best approach anyhow.  The best approach is either to use a CROSS APPLY/TOP(1) or to use a CTE/ROW_NUMBER.  The CROSS APPLY/TOP(1) tends to perform better...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Select row based on another column's value from another table

    With an appropriate index, the following may perform better.  The index would be on Vendor(INV_ITEM_ID, ITM_VNDR_PRIORITY).


    SELECT vu.*
    FROM #Vendor_UOM vu
    CROSS APPLY
    (
        SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 946 through 960 (of 4,085 total)