Forum Replies Created

Viewing 15 posts - 661 through 675 (of 4,086 total)

  • RE: Sub queries In access

    jeannier1975 - Wednesday, February 13, 2019 1:38 PM

    drew.allen - Wednesday, February 13, 2019 1:30 PM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Sub queries In access

    I would take a different approach.  Your two queries are very similar.  Rewrite your query to pull any record that would meet either criteria and then use two CASE/IF expressions:...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Filter by column that is datetime, so only rows that had a ref in time period show up

    I actually prefer using the first of the month to group dates. 

    • There is a fast way to determine the first of the month for any date.
    • You can...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Increment dates for a set of records

    barry.nielson - Tuesday, February 12, 2019 3:17 PM

    Hi Drew,

    Gee, thanks so much for the effort here.  Much appreciated.

    I am using SQL 2008...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How can I write this query?

    You can simplify this by using a different default value for the lag function.


    WITH LAG_DATA AS (

        SELECT
            TT.rn,
            TT.dt,
            TT.[status],
           ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Converting Varchar to Date

    You can also use TRY_CAST() or TRY_CONVERT() to identify which records have issues.  Each of these will produce a NULL value instead of an error when the conversion fails.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SQL Script

    Luis Cazares - Wednesday, February 13, 2019 8:32 AM

    This is a very expensive way of doing it. Unpivoting and pivoting the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Increment dates for a set of records

    It's not quite in the format you asked for, but it can easily be tweaked.

    CREATE TABLE #Customer_Balances
    (
        Customer_ID        INT
    ,   Cur_Balance        MONEY
    ,   As_of_Date       ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using Computed Columns

    thisisfutile - Tuesday, February 12, 2019 12:54 PM

    drew.allen - Tuesday, February 12, 2019 12:26 PM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using Computed Columns

    thisisfutile - Tuesday, February 12, 2019 11:57 AM

    We have a database that is filled with tables utilizing an integer column for things...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Using Computed Columns

    Mike D - Tuesday, February 12, 2019 7:55 AM

    Why not use a view for computed columns? Is this not clearer?

    I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Dynamic SQL to iterate through consecutively named columns?

    I see nothing here that argues for a dynamic approach.  Post sample data and expected results, and we should be able to help you come up with an approach that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SQL Script

    You also need to specify the logic used to determine which values appear together.  NOTE: Tables represent sets, which are unordered.  The display order is not a valid option.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Multilayer Hierarchy

    Paul Giles-Randall - Friday, February 8, 2019 7:15 PM

    I think the drawing  lost some depth.
    So I have tried to add it again.

    [CompanyId](Display:...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: insert from an Excel linked server did not enforce table constraints

    Excel does not have a NULL value.  It has a BLANK value which is equivalent to ''.  When '' is converted to numeric, it is converted as 0.  You may...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 661 through 675 (of 4,086 total)