Viewing 15 posts - 61 through 75 (of 259 total)
--===== If the test table already exists, drop it
IF OBJECT_ID('TempDB..#TeamSales','U') IS NOT NULL
DROP TABLE #TeamSales
--===== Create...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 11, 2008 at 9:31 am
What would be the best way to get you some sample data?
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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.
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 10, 2008 at 1:53 pm
Thanks guys, I read about NULL and used your suggestion and it worked.
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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'...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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?
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 8, 2008 at 9:04 am
The first one worked. THanks.
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 3, 2008 at 2:21 pm
That worked great. The final code was:
UPDATE t
SET points = points + 1
FROM #Temp6 t
INNER JOIN (SELECT ConsultantId
...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 3, 2008 at 12:29 pm
Can you give me an example? That sort of confused me.
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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.
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
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 =...
Thanks,
Art
Database Analyst
Tastefully Simple, Inc.
alorenzini@tastefullysimple.com
" Some days, it's not even worth chewing through the restraints!
April 1, 2008 at 8:30 pm
Viewing 15 posts - 61 through 75 (of 259 total)