Forum Replies Created

Viewing 15 posts - 1 through 15 (of 123 total)

  • RE: Caching Report for all Accounts

    Thanks Mohamed, but I was thinking about cache only because the user can see a report but not an excel and also we can cache the report for every certain...

  • RE: Stored Procedure with interesting behavior

    Eirikur Eiriksson (7/9/2015)


    Quick question, any reason for not supplying the information needed to answer the question?

    😎

    Sorry I couldn't do it right away because I don't have access to the execution...

  • RE: Stored Procedure with interesting behavior

    1) local variables just shift parameter sniffing to a different form of problem

    2) remove local variables and use the sproc parameters and then try option recompile (preferably on just the...

  • RE: Help with a query

    coachmkavanaugh (7/8/2015)


    Oh my, it works!!!!!

    I cannot thank you enough!!!! You have saved me a many man hours trying to filter and cut down a big list!!!!!

    Thank you, thank you,...

  • RE: Help with a query

    coachmkavanaugh (7/7/2015)


    Thank you, this returns the one row for a test case! Is there a way to apply this so it would return the highest level row for a meet...

  • RE: Help with a query

    How about this?

    ;WITH CTE AS

    (

    select b.id AS SwimmerID --(Assuming you have a swimmer ID)

    , b.last_Name

    , b.first_name

    ,FLOOR(DATEDIFF(day, b.birthdate, getDate()) / 365.25) as 'Age'

    , c.event_descr as 'Event'

    , d.meet_descr as 'Meet'

    ,...

  • RE: Pivoting question

    @steve-2, your query failed with an error message LAG doesn't have an OVER clause. So I added that with partition between AccountID.

    Next, It actually prints the flag for...

  • RE: Pivoting question

    Here's another shot at it - I don't have a 2012 instance to test it, and I can definitely learn something from someone testing it and letting me know if...

  • RE: Pivoting question

    Here's a possible solution. I included the full DDL and added some sample data. Take a look and ask any questions that you might have.

    Thanks Luis. Works like a Charm....

  • RE: Pivoting question

    Are you using SQL Server 2012?

    Yes I am.

  • RE: Pivoting question

    Luis Cazares (6/30/2015)


    I was exactly going to suggest the @Points table because I had to use a triangular join which might cause problems.

    Using your new Points table, here's a possible...

  • RE: Adding a value to a 'date' column caused an overflow

    May be the rownum is so high it goes beyond the date datatype of Salesdate. Is salesdate date / datetime?

  • RE: Pivoting question

    I tried to change the @points and tried the below code but the problem is I am seeing the flag active for other period also.

    DECLARE @test-2 TABLE

    (

    AccountID INT,

    Datekey...

  • RE: Help with a query

    Are you looking for the record with lowest cut difference everytime for each swimmer? I am guessing that will have the highest motivational_description according to your data, is that a...

  • RE: Building a Tree Structure in an efficient and faster way.

    Matt Miller (#4) (6/25/2015)


    here's ONE way to take on selectively "moving" certain subtrees. I am showing you a select version for you to compare - would be easy to...

Viewing 15 posts - 1 through 15 (of 123 total)