Viewing 15 posts - 46 through 60 (of 258 total)
it seems like it's inserting a blank row for each of the Filtere statements that it passes through. So I end up with for empty rows instead of just one.
April 24, 2008 at 10:02 am
This almost works but it's ignoring the last ELSE:
ELSE Select Distinct OrigConsID, ORigConsName
FROM #DlFiltered WHERE ConsultantID IS NULL
April 23, 2008 at 2:15 pm
I think I almost have this. Current code:
IF @LineFilter = ('Only Line 1')
BEGIN
SELECT DIstinct * from #DLFiltered WHERE Active = 1
AND DownlineLevel = 1
AND EffectiveDate BETWEEN @StartPeriodDate AND...
April 23, 2008 at 1:16 pm
Thanks a lot that worked like a champ.
April 23, 2008 at 11:26 am
I recieve the following message:
Msg 144, Level 15, State 1, Line 13
Cannot use an aggregate or a subquery in an expression used for the group by list of a GROUP...
April 23, 2008 at 10:55 am
Lets see if I can explain the what I am seeing ( I am now getting two records set back, one that is empty (expected) and one with all the...
April 22, 2008 at 3:21 pm
It doing the insert regardles of a empty record set. I am a bit confused now, in my brain I would think it needs to look something like this:
IF @LineFilter...
April 22, 2008 at 2:51 pm
Doing it this way how does it know what filter to use?
IF EXISTS (SELECT NULL FROM #DLFiltered
WHERE Active = 1
AND DownlineLevel = 1
...
April 22, 2008 at 2:30 pm
What I expect to see would be that in the If Statement did not return any rows then a insert would happen into the table and then that row would...
April 22, 2008 at 10:27 am
This works great but I am having issue with my Filter statement:
CREATE TABLE #DLFiltered(
[OrigConsID] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OrigConsName] [nvarchar](101) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ConsultantID] [nchar](13) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Downlinelevel] [int] NULL,
[ConsultantName] [nvarchar](101) COLLATE...
April 21, 2008 at 3:20 pm
I created the Temp Table but how would I change my current code into the INSERT Statement:
Current COde:
Select 'OrigConsID' = @ConsultantID
,(Select Top 1 FirstName + ' ' + LastName...
April 21, 2008 at 12:09 pm
This is the code that seems to make it work appropriately:
Select DISTINCT t.ConsultantID,
t.ConsultantName,
t.CurrentLevelXID,
MAX(t.EffectiveDate) AS EffectiveDate,
s.Title,
t.NACDate,
t.BillToState,
t.HomePhone,
t.SponsorXID,
t.SponsorID,
c.FirstName + ' ' + c.LastName AS SponsorName,
t.DeactivationDate,
t.Active
,t.ReactivateDt
from #Temp3 t
Left Outer Join Consultant c ON...
April 17, 2008 at 8:01 am
Not a problem. I will start doing that in the future.
April 15, 2008 at 9:22 am
Geez. Well it is Monday!!! Thanks a lot that worked.
April 14, 2008 at 8:22 am
I figured out that that one of the columns was typed wrong. After I corrct that everything started to work. Thanks.
April 14, 2008 at 6:57 am
Viewing 15 posts - 46 through 60 (of 258 total)