Forum Replies Created

Viewing 15 posts - 931 through 945 (of 1,082 total)

  • RE: Previous Row + Current Row calculation

    Hi,

    This might help you get a start in the right direction

    ;With MyCTE(ROWNUM,EmpNo,PerDate,PerformanceData,GrossData)

    as

    (SELECT

    ROW_NUMBER() OVER (PARTITION BY EmpNo ORDER BY EmpNo,PerDate)

    ,EmpNo,PerDate,PerformanceData,GrossData

    FROM @Vtbl)

    SELECT

    [1].ROWNUM

    ,[1].EmpNo

    ,[1].PerDate

    ,[1].PerformanceData

    ,[1].GrossData

    ,[2].PerformanceData

    FROM MyCTE [1]

    LEFT JOIN MyCTE [2]

    ON [1].ROWNUM =...

  • RE: Previous Row + Current Row calculation

    Please could you post an example of what you want your results to look like?

    thanks

    Chris

  • RE: sum(),Cummulative addition,Case statement

    Here is another solution.

    SELECT

    CompanyId

    ,TransactionId

    ,RestrictedId

    ,CASE WHEN (SUM(CAST(RestrictedId as INT)) OVER (PARTITION BY CompanyId) = 0)

    THEN 'Grey'

    ELSE CASE WHEN RestrictedId = 0

    THEN 'BR'

    ...

  • RE: Only Keep The First Occurance

    ooooops sorry it's late in the day

    this is what you want (removing the one note field)

    SELECT

    Course

    ,Room

    ,DAte

    , CASE WHEN Row_Number() OVER (PARTITION BY Course,DAte Order BY Course,DAte) = 1

    THEN NOTE

    ELSE...

  • RE: Only Keep The First Occurance

    Hi,

    This should also do the trick for you:

    SELECT

    Course

    ,Room

    ,DAte

    ,NOte

    , CASE WHEN Row_Number() OVER (PARTITION BY Course,DAte Order BY Course,DAte) = 1

    THEN NOTE

    ELSE NULL

    END as [Note]

    FROM MyTable

    Thanks

    Chris

  • RE: Help needed insearching

    Hi,

    Can't you use this:

    Replace([Name],'''','')

    thanks

    Chris

  • RE: DBCC CHECKIDENT

    SILLY SILLY SILLY

    Me

    what I have done is add:

    DBBCC CHECKIDENT(Mytable,reseed)

    After I reseed it to 0 so that it corrects it's self.

    Thanks for all the help 🙂

  • RE: DBCC CHECKIDENT

    Sorry I made a mistake with my last set of Data

    Mytable2

    has a row count of 67 with the largest Identity value of 68

    Does the row count actually make any difference,...

  • RE: DBCC CHECKIDENT

    Thanks for the reply.

    That what I would expect to happen.

    The current table count is 5.

    So if I make it 0 it should be 5+1 which is 6.

    I have tried the...

  • RE: Find first non-numeric Charater in a string

    hi Guys,

    Thanks all for the reply 🙂

    I feel like an idiot, I totally forgot about the PatIndex function he he he

    Thanks again

    Chris

  • RE: Query Count Value In a Row

    HI,

    Will you always only have three cols to check and count?

    Also how do you want your results returned?

    thanks

  • RE: Triggers per second

    Chirag has a very good point are you dealing with each insert on it's own or are you simply doing batch processing?

    Some sample code would help a lot.

    Thanks

    Chris

  • RE: what is mean by An umbrella company ?

    Hi,

    It really depends what you mean by working for an Umbrella company.

    If you are working under an Umbrella company, what this means is that you are a "ShareHolder" with in...

  • RE: "Select Where In" using a parameter?

    HI,

    It's because your ID column is an Interger and you are comparing it to a string of value, '313352,313353'

    Hope this helps.

    Thanks

    Chris

  • RE: qUERY Performance

    Hi All,

    Would it not also be faster to use Left Joins instead for WHERE IN (Select) statements?

    Thanks

    Chris

Viewing 15 posts - 931 through 945 (of 1,082 total)