Forum Replies Created

Viewing 15 posts - 121 through 135 (of 3,544 total)

  • Reply To: ssrs 2012 report have page break parameter based upon the 'sort' parameter value

    In yours it is 'Group by', click in the fx button to show the expression box and use something like this

    =Choose(Parameters!SortParam.Value+1,
    Fields!StudentName,
    Fields!Grade,
    Fields!Team,
    Fields!Teacher,
    Fields!HomeroomNumber
    )

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: ssrs 2012 report have page break parameter based upon the 'sort' parameter value

    Add a parent group and set the 'Group on' using an expression that selects the Field(s) depending on the sort value and set page break on that group.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Return a value if record does not exist

    SELECT ISNULL((
    SELECT price FROM products
    WHERE productname = 'bob'
    ),0) AS [price]

    This will only work if only one or no row is found in matching

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Fastest Way to Calculate Total Number of records inserted per day

    Jeff Moden wrote:

    Also, do you have some proof of the COUNT(*) vs the COUNT(1) thing?  I'm not talking about someone's rhetorical "proof" either.  I'm talking about a demonstrable and repeatable bit...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Query tuning help

    Jeff Moden wrote:

    vsamantha35 wrote:

    We are small shop and we don't get to hire any dedicated consultant for performance tuning.  Everything has to be done by us!

    Thanks everyone. Forgive me if...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Are the posted questions getting worse?

    I am lucky that I have a good job (Dev/DBA) that I enjoy with a good wage, but no upward career path other than management, although 36 years ago when...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Are the posted questions getting worse?

    MVDBA (Mike Vessey) wrote:

    getting back to the original topic - are the posted questions getting worse.?

    hell yes...there was one today that was "I have query, make it faster"  - several of us...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Row_Number for grouping to find min and max values

    Changed my post above accordingly.

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Row_Number for grouping to find min and max values

    Sorry for the delay I thought I had already posted this.

    This is a variation of my solution

    SELECTEvStrName,
    RN,
    LeadRN-RN As [PassOB],
    LeadActualArriveTime-ActualArriveTime AS [Time],
    LeadOdometer-Odometer AS [Miles]
    FROM(
    SELECTEvStrName,RN,
    ActualArriveTime,ActualDepartTime,Odometer,
    LEAD(RN,1,0) OVER (ORDER BY EvStrName,RN)...

    • This reply was modified 6 years, 6 months ago by David Burrows. Reason: Changed NonAmb in NOT EXISTS

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: It's More Than What You Know

    Jeff Moden wrote:

    Exactly and well said.  And if someone keeps in mind that there will almost always be...

    2.A better answer...

    Especially with my code :-/

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: How SQL Server Can Just Go Faster

    Jeff Moden wrote:

    All that being said, I'm scared to death of moving from 2016 to 2019 next year and MS has done nothing to quell the ongoing fears associated with their...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Row_Number for grouping to find min and max values

    OK several things. The data is different which requires rewriting the query. How is this data generated? Is it going to continually change format as this will make any solutions...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Row_Number for grouping to find min and max values

    tacy.highland wrote:

    ... older SQL version …  I'm guessing the query would turn into a CTE with multiple queries to determine the Lead "manually" using the RN column? 

    Correct (or a temp...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: Row_Number for grouping to find min and max values

    Not elegant but...

    SELECTEVSTRNAME,RN,PASSOB,[TIME],MILES
    FROM(
    SELECTEVSTRNAME,RN,
    LEAD(RN,1,0) OVER (ORDER BY EVSTRNAME,RN)-RN AS [PASSOB],
    LEAD(ACTUALARRIVETIME,1,0) OVER (ORDER BY EVSTRNAME,RN)-ACTUALDEPARTTIME AS [TIME],
    LEAD(ODOMETER,1,0) OVER (ORDER BY EVSTRNAME,RN)-ODOMETER AS [MILES]
    FROM(
    SELECTEVSTRNAME,RN,ACTUALARRIVETIME,ACTUALDEPARTTIME,ODOMETER
    FROM#test
    WHEREpassob_bit = 0 OR RN = 1
    UNION...

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Reply To: SQL View - Pivot

    bbranco wrote:

    Thanks for the reply, but I can't have the item numbers in there or the values in the FROM Values area.

    Sorry but I do not understand your reply.

    What I...

    Far away is close at hand in the images of elsewhere.
    Anon.

Viewing 15 posts - 121 through 135 (of 3,544 total)