Viewing 15 posts - 61 through 75 (of 258 total)
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#TeamSales','U') IS NOT NULL
DROP TABLE #TeamSales
--===== Create...
April 11, 2008 at 9:31 am
What would be the best way to get you some sample data?
April 10, 2008 at 3:08 pm
For this particular COnsultant the amount should be the same because the AMount never changes regardless of the Achievelevel in which they are 60,70, and 80.
April 10, 2008 at 1:53 pm
Thanks guys, I read about NULL and used your suggestion and it worked.
April 10, 2008 at 12:47 pm
I did a join to the temp table to see if that would get rid of the SubQuery issue but now I get duplicate records:
SELECT v.ConsultantID
,SUM(PurchaseAmount) AS PORSalesTotal
,'PORSalesPoints'...
April 8, 2008 at 2:05 pm
With a little more input from BA I found myself going at this backward. In some cases I would be returning more than one row which leads to an issue...
April 8, 2008 at 12:26 pm
I see the the issue, the achievelevel changes so how can I go about suppressing the second row?
April 8, 2008 at 10:34 am
I added the MIN as you suggested and it gives me a single record but none of the Case statements seem to work. I also tried it with MAX and...
April 8, 2008 at 9:04 am
That worked great. The final code was:
UPDATE t
SET points = points + 1
FROM #Temp6 t
INNER JOIN (SELECT ConsultantId
...
April 3, 2008 at 12:29 pm
Can you give me an example? That sort of confused me.
April 3, 2008 at 8:40 am
Any ideas on this?
I have a question on the following code:
Update #tConsultantPoints SET points = points + 1
FROM #tConsultantPoints tCon
INNER JOIN OtherTable ot ON ....
where ot.month = @targetMonth AND...
April 3, 2008 at 7:21 am
I have a question on the following code:
Update #tConsultantPoints SET points = points + 1
FROM #tConsultantPoints tCon
INNER JOIN OtherTable ot ON ....
where ot.month = @targetMonth AND lifetimePORSales > 1000...
April 2, 2008 at 2:15 pm
It is run when ever a consultant wished to see the list. So it's will be pretty sporatic.
April 2, 2008 at 10:38 am
This work greats. The final code:
DECLARE @BeginIssueDate Datetime
DECLARE @EndIssueDate DateTime
DECLARE @CertType VARCHAR(50)
DECLARE @CertGRoup VARCHAR(50)
DECLARE @CertStatus VARCHAR(50)
DECLARE @StatusID int
--Exec uspS_CertificateListing '01/01/2008','04/01/2008'
SET @BeginIssueDate = '01/01/2008'
SET @EndIssueDate ='04/01/2008'
SET @CertType = 'Retail'
SET @CertGroup =...
April 1, 2008 at 8:30 pm
Viewing 15 posts - 61 through 75 (of 258 total)