Viewing 15 posts - 931 through 945 (of 1,082 total)
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 =...
May 16, 2008 at 8:55 am
Please could you post an example of what you want your results to look like?
thanks
Chris
May 16, 2008 at 8:32 am
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'
...
May 16, 2008 at 4:45 am
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...
May 15, 2008 at 10:44 am
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
May 15, 2008 at 10:42 am
Hi,
Can't you use this:
Replace([Name],'''','')
thanks
Chris
May 15, 2008 at 6:46 am
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 🙂
May 14, 2008 at 2:48 am
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,...
May 14, 2008 at 2:42 am
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...
May 14, 2008 at 2:37 am
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
April 30, 2008 at 4:17 am
HI,
Will you always only have three cols to check and count?
Also how do you want your results returned?
thanks
April 24, 2008 at 8:26 am
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
February 21, 2008 at 1:39 am
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...
February 20, 2008 at 12:55 am
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
February 19, 2008 at 8:05 am
Hi All,
Would it not also be faster to use Left Joins instead for WHERE IN (Select) statements?
Thanks
Chris
February 19, 2008 at 2:50 am
Viewing 15 posts - 931 through 945 (of 1,082 total)