Forum Replies Created

Viewing 15 posts - 2,296 through 2,310 (of 4,085 total)

  • RE: Monthly total of active data

    Thom A (10/5/2016)


    Does this meet your needs? You'll need to change the values of the @StartDate and @EndDate Variables to suit your needs though.

    DECLARE @StartDate DATE = '01-Jan-2016',

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Monthly total of active data

    Thom A (10/5/2016)


    Does this meet your needs? You'll need to change the values of the @StartDate and @EndDate Variables to suit your needs though.

    DECLARE @StartDate DATE = '01-Jan-2016',

    ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Monthly total of active data

    Why are some people with partial months included and others excluded? Is there a minimum number of days required to be counted? Or are you only counting people who...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Get list of tables used in a stored procedure

    You do realize that this thread is so old that the original article was likely written for SQL 2005, which is now deprecated. None of the scripts mention which...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Case Statement in a conditional Where Clause

    A CASE statement cannot return a Boolean value. You can however return a bit or string that represents a Boolean value and test whether it returns a token that...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Summary table for roll-up

    SvetNas (10/4/2016)


    @drew.allen thanks for the great suggestion! Roll up definitely helps with some levels of aggregation. I don't think it could be used to pre-aggregate data for all subsets,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query processing

    I think the main issue is a confusion between logical query processing and physical query processing. The physical query processing does not need to match the logical query processing...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to use sp_msforeachdb to create multiple table in multiple databases

    ScottPletcher (10/4/2016)


    Create a proc in the master db, beginning the name with "sp_", mark that proc as a system object, then use sp_MSforeachdb to run the proc in the db(s)...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Syntax help please

    What datatype are your monthbegindate and monthenddate in that they need to be converted to VARCHAR before being converted to DATETIME?

    Why are you converting monthbegindate and monthenddate to DATETIME rather...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to use sp_msforeachdb to create multiple table in multiple databases

    You have to be careful with sp_MSforeachdb, because it will also run in the system databases. I assume that you don't really want to create these tables in master,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Summary table for roll-up

    Eric M Russell (10/4/2016)


    So, you have this flat denormalized table containing nearly 100 million rows and 100+ columns. The problem is you need to report from it; performing rollups at...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Summary table for roll-up

    Unfortunately distinct counts is one of the properties that is not associative, so you need to do all levels of the calculation at the same time. When creating your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Combine 2 fields from 5 tables into one list?

    When directing answers to another forum, it really helps to post a link to that other forum.

    http://www.sqlservercentral.com/Forums/Topic1823226-150-1.aspx

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Report to pull UserID field and Date field from 5 tables and display a List?

    You don't say what you want to do when you have multiple entries for a single user in any one of the tables. The solution provided will give you...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Looping through rows and applying a count

    TheSQLGuru (10/3/2016)


    This sure does seem a LOT simpler, and easier for a newbie (and this old brain too!) to understand:

    SELECT t2.name, COUNT(*)

    FROM dbo.#stat t1

    --get the G events...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,296 through 2,310 (of 4,085 total)