Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored Procedure Trouble
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00596982
Message ID:
00597381
Views:
22
In this case something wrong in your logic. Run following select to see Id ranges for each usertype.
SELECT OutbackLogin.OLUserType, MIN(OGC.OGCID), MAX(OGC.OGCID)
from OGC inner join OutbackLogin ON OGC.OGCID = OutbackLogin.OLUserID
GROUP BY 1
SELECT @UserType= OLUserType FROM OutbackLogin WHERE (OLUserName = @LoginName)
> If @UserType='TM'
> /* Grab all of the Territory Managers' OGC's */
> select distinct * from OGC inner join
> OutbackLogin ON OGC.TERRMGRID = OutbackLogin.OLUserID
> WHERE (OutbackLogin.OLUserName = @LoginName)
> order by businessname,lastname,firstname
> Else If @UserType='OGC'
> /* Grab the single OGC information - This should work the same as the Load method of the DB object */
> select distinct * from OGC inner join
> OutbackLogin ON OGC.OGCID = OutbackLogin.OLUserID
> WHERE (OutbackLogin.OLUserName = @LoginName)
> order by businessname,lastname,firstname


>Yes, I did not receive any results for those usertypes.
>
>>>Logically that should work, but I tried it and it still does not work.
>>
>>Hi Matt,
>>
>>Could you quote my replies otherwise it's hard to follow discussion.
>>
>>Are you saying that you didn't get any CSR or ADMIN in the select result?
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform