Forum Replies Created

Viewing 15 posts - 3,616 through 3,630 (of 4,820 total)

  • RE: PERCENT_RANK() problems

    CPiacente (6/22/2015)


    Thank you for the information. I will look into that. In addition however, I noticed some percent_rank() values would only get to around 65% or so as the max....

  • RE: SQL server View runnning Slow

    dhanekulakalyan (6/19/2015)


    Hi Gail,

    I just gave one example 141928888M here thats the claimid field there are 3.7 claimids eg: 22141213888M or 33333356A123 something like that.

    Thanks,

    Kalyan

    I don't see how that answers...

  • RE: PERCENT_RANK() problems

    CPiacente (6/19/2015)


    Thanks for the suggestion. I tried it but I got the same results. Any other suggestions?

    There's always the option of using a CASE statement to set the value to...

  • RE: Help with Query - Counting item Occurrence over a rolling 72 hour period

    jparks 85798 (6/19/2015)


    Steve,

    Thank you SO much for the assistance. I didn't think about removing the extraneous Minutes and seconds. I adjusted the code to pull from my...

  • RE: Trying to use T-SQL to calculate elapsed time

    With SQL 2012, the query can actually be simplified:

    DECLARE @Spec1 AS TABLE (

    Spec1ID int IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,

    Channel int NOT NULL,

    [Timestamp] datetime NOT NULL,

    Lambda decimal(8, 2) NOT NULL,

    [Power]...

  • RE: PERCENT_RANK() problems

    CPiacente (6/19/2015)


    Hello,

    I have a formula I am having difficultly with and cannot seem to find a solution for it. My understanding of the PERCENT_RANK function is it will break up...

  • RE: SQL server View runnning Slow

    GilaMonster (6/19/2015)


    dhanekulakalyan (6/19/2015)


    3) The reason I kept '%141928888%' is there will be CID like 141928888S12 or 1419288881X2 or 14192888812A or 14192888812 or 141928888M121 . So we need to get the...

  • RE: Error converting data type varchar to numeric

    Lynn Pettis (6/18/2015)


    sgmunson (6/18/2015)


    Lynn Pettis (6/17/2015)


    The problem is the commas in the string. Try this select statement:

    select CONVERT(NUMERIC(17,2),replace(@stg,',',''))

    Yes, it will get rid of the commas, but it seems odd...

  • RE: Help with Query - Counting item Occurrence over a rolling 72 hour period

    jparks 85798 (6/18/2015)


    This is probably a mess, but it does the trick:

    declare @start datetime

    declare @end datetime

    set @start = GetDate()

    set @end = dateadd(hour,72,GetDate())

    while @start < dateadd(day,30,getdate()) begin

    Insert Into...

  • RE: SQL server View runnning Slow

    A couple of thoughts:

    1.) Any chance you can UPDATE the base table's CID field to be LTRIM(RTRIM(CID)) on an overnight job and no longer have to deal with those parts...

  • RE: Combined Ranking

    What do we do if the quantity from any one shop isn't large enough?

  • RE: Indexing Dates

    For the original poster, the ROW_NUMBER() function you're looking for would look like this:

    ROW_NUMBER() OVER(PARTITION BY [Name] ORDER BY [Date]) AS Weekdays

    The PARTITION BY portion will start the numbering over...

  • RE: CTE (?) or query help

    Travis Dean (6/18/2015)


    Thank you Steve - I was having a hell of a time trying to figure out the join that didn't have a join in the CTE. Are there...

  • RE: Help in making query for presenting data in different format

    sqlinterset (6/18/2015)


    Sorry for confusion, while testing few of the conditions came in picture. here is the updated one:

    create table #cs([Year] float,

    [Week] float,

    [Month] float,

    [C#] float,

    [Dept] nvarchar(255)

    ,[Issue] nvarchar(255), [Type] nvarchar(255), [Dept age]...

  • RE: Help in making query for presenting data in different format

    sqlinterset (6/18/2015)


    This is working but failing for specific conditions like where for a perticular week, if no data exist for a perticular category combination, then its assigning c1 as previous...

Viewing 15 posts - 3,616 through 3,630 (of 4,820 total)