Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Stored procedure for Median

    Hi Peter,

       I ran ur query. I got same result as previous first query. I want to combine the both the results into one like below.

    RequstType      Priority     Median    TicketCount

    KCR Request       2            ...

  • RE: Stored procedure for Median

    Thanks Peter.. It worked.

    Now I have one more task is that I have 2 stored procedures. 

    1. is the o/p columns that you created Request-type, Priority, median and ticket count based on...

  • RE: Stored procedure for Median

    This is the result i am expecting

     

    TypeofRequest  Priority  Median   Count

    ---------------  --------  ------ ------

    KCR Request             1     5.0   5

    KCR Request             2     5.0   3

    KCR Request             3     5.5   4

    MPR Request             1     2.0   6...

  • RE: Stored procedure for Median

    Hi Guys,

    Hi Peter,

       First , Thanks much for providing solution for the Median.

    Little expansion on that query. I need to add a column "number of count" based on priority and...

  • RE: Passing Variables down the Sub-subqueries

    Hi Guys,

        Thanks much for all ur effort.  Your ideas brought me to think in different ways to work it out and it worked. I executed that sql statements in the...

  • RE: Passing Variables down the Sub-subqueries

    Hi Scott,

       i tried that too. It didn't work and same error encountered

  • RE: Passing Variables down the Sub-subqueries

    Query works fine if I hardcode the values Begindate and enddate with "20060501" and "20060601".

    By the way I even tried the last query posted here by PAM and it didn't...

  • RE: Passing Variables down the Sub-subqueries

    I did that. Here is my query with declaring begindate and enddate. I am getting same error.

     

    Declare @BeginDate varchar(8)

    Declare @EndDate varchar(8)

    Select @BeginDate = convert(varchar,DateAdd(mm, DateDiff(mm, 0, dateadd(mm, -2,...

  • RE: Passing Variables down the Sub-subqueries

    Here is the actual query. The variables we pass are used in openquery select statement where he it will be executed in another server.

    Drop table My_main_table;

    CREATE Table My_Main_Table

    (  Request_Type VARCHAR(20),

      ...

  • RE: Passing Variables down the Sub-subqueries

    I tried but still same error.

    "Server: Msg 8180, Level 16, State 1, Line 1

    Statement(s) could not be prepared.

    Server: Msg 137, Level 15, State 1, Line 1

    Must declare the variable

  • RE: Stored procedure for Median

    Thanks much Peter. It worked.

  • RE: Stored procedure for Median

    Hi Peter,

      That is the similar output I am looking for but based on both Type of Request and Priority. 

    thanks

    Suresh Alluri

Viewing 12 posts - 1 through 12 (of 12 total)