Forum Replies Created

Viewing 15 posts - 2,731 through 2,745 (of 4,085 total)

  • RE: Set end date for a row to start date of next row minus 1 day

    smw147 (4/12/2016)


    Thanks for that 🙂 Never heard of LEAD before. Very interesting.

    LEAD and LAG were introduced with SQL2012. You won't be able to use them if you are...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Currency Comversion SSAS

    I would expect your fact_Sales table to have a sale date and you would use that to determine the exchange rate on the date of the sale.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SQL Oddity

    Eirikur Eiriksson (4/11/2016)


    GSquared (4/11/2016)


    I just ran into this in a query. Can anyone come up with a good explanation for why anyone would do this?

    SELECT

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: include results from table not found in another table

    You student_quiz_session_data table represents a many-to-many relation between your students and your quiz_data and is a subset of all possible pairings of your students and your quiz_data. It is...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Rows repeating

    This is a presentation issue and is best left to the presentation layer, SSRS for example.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Replace a capital letter in a string

    Alan.B (4/6/2016)


    You could also do this:

    REPLACE(value, char(88), '/')

    The replacement depends on the collation, and the default collation is case insensitive. Using the CHAR() function, does not change the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Handling xml data and formatting into separate table

    Eirikur Eiriksson (4/4/2016)


    drew.allen (4/4/2016)


    Eirikur Eiriksson (4/4/2016)


    As I posted earlier, "suggestion towards a solution", in fact the desired output is the output of the first CTE without the filter

    No, the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Handling xml data and formatting into separate table

    Eirikur Eiriksson (4/4/2016)


    As I posted earlier, "suggestion towards a solution", in fact the desired output is the output of the first CTE without the filter

    No, the OP is asking...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Eirikur Eiriksson (4/4/2016)


    Brandie Tarvin (4/4/2016)


    At 11:55 p.m., my boss asked me if there was anything else he could do. At that point it was a one person job which I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Handling xml data and formatting into separate table

    Eirikur Eiriksson (4/4/2016)


    Here is a quick suggestion towards a solution, let us know if you need more assistance.

    😎

    USE tempdb;

    GO

    SET NOCOUNT ON;

    DECLARE @XQUERY_STR NVARCHAR(MAX) = N'';

    DECLARE @PARAM_STR NVARCHAR(MAX) = N'@TXML1...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Find out the record with that falls in the date range

    Codd suggested that there should be two different values for missing data: A-Values and I-Values representing missing and applicable and missing and inapplicable respectively, but SQL only represents a single...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert a string with an array of variables?

    Sergiy (3/31/2016)


    drew.allen (3/31/2016)


    Hard-coding the translation table is not necessarily a bad idea if the translation table is relatively small and the table rarely, if ever, changes. You need to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert a string with an array of variables?

    Sergiy (3/31/2016)


    drew.allen (3/31/2016)


    I specifically said Inline Table-Valued Function, precisely because they are inlined. Scalar functions are never inlined, which is why it can make sense to create an inline...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert a string with an array of variables?

    Sergiy (3/31/2016)


    drew.allen (3/31/2016)


    It's actually MUCH faster to create a table using the VALUES expression, because most of the cost is writing and reading the temp table to tempdb. If...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Convert a string with an array of variables?

    Sergiy (3/31/2016)


    drew.allen (3/31/2016)


    It's actually MUCH faster to create a table using the VALUES expression, because most of the cost is writing and reading the temp table to tempdb. If...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,731 through 2,745 (of 4,085 total)