Forum Replies Created

Viewing 15 posts - 1,231 through 1,245 (of 4,085 total)

  • RE: Count(*) with LIKE

    Jackie Lowery - Wednesday, February 14, 2018 6:29 PM

    If you have a query already that returns the region and product line, the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Average number of records per hour per datetime range

    subramaniam.chandrasekar - Thursday, February 15, 2018 6:36 AM

    TheSQLGuru - Wednesday, February 14, 2018 3:00 PM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Count(*) with LIKE

    It is guaranteed.  From CASE (Transact-SQL)

    The CASE statement evaluates its conditions sequentially and stops with the first condition whose condition is satisfied.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Genreal Query Question

    Luis Cazares - Wednesday, February 14, 2018 1:55 PM

    Don't aggregate the values on your Widget table, just group by them.

    SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need Help Creating a Loop for Dynamic Stored Procedure

    David92595 - Wednesday, February 14, 2018 12:24 PM

    Apologies, the template is created via another action. I need to update the data.

    The two...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to remove columns that are empty or that have duplicate values

    If I understand your question correctly, you can't.  SQL Server enforces first normal form which requires that all records have the same shape.  That means that all records have to...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Need Help Creating a Loop for Dynamic Stored Procedure

    You say you want to create records, but your code is updating records.

    Also, I see absolutely no reason to use dynamic SQL here.  Because you are using dynamic...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Count(*) with LIKE

    You need to replace your COUNTIF with a COUNT(CASE .... WHEN ...) 

    For example,  COUNT(CASE WHEN [Sub Product Line] LIKE '%HMO' THEN 1 ELSE NULL END).

    While the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: http://www.southafricasupplements.co.za/reducelant-garcinia/

    Reported.

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Business Day Function - Count today as 1

    amy26 - Wednesday, February 14, 2018 8:50 AM

    Thank you, wow!  I thought I was pretty good at SQL... guess not. 😉

    So I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Business Day Function - Count today as 1

    The main issue here is that you are using an iterative approach instead of a set-based approach.  Also, inline table valued functions are going to perform much better than scalar...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Datediff and divide by zero problem

    stuart.davison 8016 - Tuesday, February 13, 2018 4:27 AM

    Hi All,

    I'm using the script below to calculate database growth based on the backup...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Context_info() data

    Steve Jones - SSC Editor - Tuesday, February 13, 2018 10:20 AM

    drew.allen - Tuesday, February 13, 2018...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Context_info() data

    Steve Jones - SSC Editor - Tuesday, February 13, 2018 9:18 AM

    TUellner - Tuesday, February 13, 2018...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Subquery returned more than 1 value. This is not permitted when the subquery follows

    Use XML concatentation.

    SELECT au.name, aau. firstname,aau.lastname,r.rolname,

    STUFF(
    (
        SELECT ',' + CAST(AccID AS VARCHAR(MAX))
        FROM [Admin] AS A
        WHERE a.Id = Au.UserId
        ORDER BY AccID
        FOR...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 1,231 through 1,245 (of 4,085 total)