Forum Replies Created

Viewing 15 posts - 931 through 945 (of 4,086 total)

  • RE: case when xxx = anything

    Assuming that ACT_Status and Status are not nullable, this should work.

    select      s.[Status], count(a.ACT_Status) [Count], s.[Rank]
    from        [(local)\ISYS].Intelligent.dbo.vwStaffStatus2 s left join
                    [(local)\ISYS].Intelligent.dbo.vwStaffDayActivity a on s.[Status] IN...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Piivot - field data contains '&'

    You haven't followed the rules for XML concatenation.  Try the following instead.

    SELECT @cols = STUFF(( SELECT DISTINCT TOP

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Query needed, Billing time of a case based on a employee with various priority time shifts.

    This is a variant on interval packing.  Here is what I came up with.  I think there is a better way to approach this, but I don't really have time...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Join date ranges with data from 2 tables

    sgmunson - Monday, September 10, 2018 9:47 AM

    Exactly.   Most "gap and island" types of problems become solvable when you're able to subtract...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How do I write a record for each day in a date range???

    Jonathan AC Roberts - Monday, September 10, 2018 8:05 AM

    drew.allen - Monday, September 10, 2018 7:51 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How do I write a record for each day in a date range???

    Jonathan AC Roberts - Saturday, September 8, 2018 7:04 PM

    It's not long in days but it is long in milliseconds. I...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Sean Lange - Friday, September 7, 2018 2:39 PM

    Oh goodness...I was just finishing up an application and ran into even more fun....

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How do I write a record for each day in a date range???

    You want to be careful here.  The DATEDIFF function causes an overflow quite quickly when using milliseconds.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Insert into Select - only new or changed rows

    Do you really want to insert changed rows?  Usually people want to update changed rows and insert new rows.  As for identifying which are new/changed, I like EXCEPT unless your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Find max Rate Id between effective and Expiry date for current/running date

    You should never use a NULL value as an endpoint of an interval.  It becomes complicated very quickly when both the beginning and end of an interval can be null. ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Report has no parameters and arguments were supplied

    You haven't set up your procedure to take parameters, but you've tried to pass in parameters.  From your procedure, it looks like you want to change it so that it...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Creating Subtotals and Totals in Aggregated Queries

    David.Poole - Thursday, September 6, 2018 1:16 AM

    I'm not clear what this syntax adds over the old WITH ROLLUP and WITH CUBE? ...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Michael L John - Wednesday, September 5, 2018 1:20 PM

    I used VI editor and copied and pasted all the code into...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Most Recent SQL Query

    Jonathan AC Roberts - Wednesday, September 5, 2018 11:13 AM

    drew.allen - Wednesday, September 5, 2018 10:23 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    I think that my degree in Linguistics actually helped prepare me more for working with databases than my degree in Mathematics did, mostly because it helped me think in a...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 931 through 945 (of 4,086 total)