Viewing 15 posts - 661 through 675 (of 1,156 total)
You lost me. Are you saying that you do not want a consultant id to display any repromotes if the latest repromote is the current level?
Additionally, what makes this...
February 13, 2008 at 7:38 am
Not quite, if the repromote is the currentlevel then don't display. The script works but it is still not suppressing the repromote is at the current level.
--if the consultant has...
February 12, 2008 at 9:23 pm
You should remove the additional where clause we put into the insert statement and use the code above instead.
This should set you right 😉
February 12, 2008 at 8:09 pm
To accomplish what you want you will need to filter the query not the insert statement.
your query should look like this:
SELECT * FROM
(SELECT DISTINCT ConB.ConsultantID,
ConB.AchieveLevel,
ConB.AchieveTitle,
ConB.PeriodEndDate,
ConB.RepFlag
FROM #C ConA
INNER JOIN #C...
February 12, 2008 at 8:07 pm
I get what you are saying now. I thought that you didnt want to see any of the repromotes at the current level.
February 12, 2008 at 6:46 pm
i had to add the distinct clause to make it work for me.
INSERT INTO @C
SELECT distinct
you may have to do this too.
February 12, 2008 at 6:39 pm
I edited my post try having the filter in the where clause. I tested this locally with success. Actually I tested both versions successfully.
February 12, 2008 at 6:34 pm
INSERT INTO #C
SELECT a.ConsultantID
,a.AchieveLevel
,a.AchieveTitle
,a.PeriodEndDate
, a.Repflag
FROM Volume a
INNER JOIN (SELECT x.i.value('.', 'VARCHAR(7)') AS [ConsultantID]
FROM @x.nodes('//i') x(i) ) as b
on a.ConsultantID = b.ConsultantID
WHERE b.ConsultantID IS NOT NULL
AND a.Level <> (SELECT TOP...
February 12, 2008 at 5:52 pm
Try coping your create table from within the stored procedure and replace the create table #test. Then rename the table to #temp. Maybe something is off with #temp's...
February 12, 2008 at 4:10 pm
This means that if you run the stored procedure against any one of those number it should return 0 results, which means that the consultant has never been repromoted.
Can you...
February 12, 2008 at 3:45 pm
If you run this what do you get
SELECT DISTINCT RTRIM(ConsultantID) + '|'
FROM contemp
February 12, 2008 at 3:36 pm
You can get your results into a string by using the same xml parsers logic.
DECLARE @ConIDs VARCHAR(MAX)
SET @ConIDs =
(SELECT DISTINCT RTRIM(ConsultantID) + '|'
FROM #mytable
FOR XML PATH(''))
select @conids
You...
February 12, 2008 at 3:06 pm
So if you execute the stored procedure it works correctly but if you try to insert the results into a table it fails?
February 12, 2008 at 2:56 pm
can you display what your conids look like in string format?
February 12, 2008 at 2:52 pm
Your insert is completing but the execution of the stored procedure is failing. Do as Jonnie suggested and run the procedre seperately. This way we can isolate the...
February 12, 2008 at 2:46 pm
Viewing 15 posts - 661 through 675 (of 1,156 total)