Opps,
I did not notice during my copy I did not include the filter. The
adminsubnet table is to filter based on who has rights to a subnet.

- Charles



SELECT 
COUNT(a.userid) AS Localusers,
(COUNT(a.winadmingroup) = 'YES') AS IsAdmin,
a.userid
        
FROM #Session.Schema#.r_localuserlist a, #Session.Schema#.adminsubnet b

WHERE   replace(a.userid,'_','~') like replace(b.subnet,'_','~')  and
        b.oid like '#Session.Username#'

group BY a.userid

On 7/5/05 12:45 PM, "Jochem van Dieten" <[EMAIL PROTECTED]> wrote:

> Charles Heizer wrote:
>> 
>> I have a table which contains local user info short name and uid and if it's
>> an admin account.
>> 
>> SELECT 
>> COUNT(a.userid) AS Localusers,
>> (COUNT(a.winadmingroup) = 'YES') AS IsAdmin,
>> a.userid
>> FROM #Session.Schema#.r_localuserlist a, #Session.Schema#.adminsubnet b
>> WHERE   b.oid like '#Session.Username#'
>> group BY a.userid
> 
> How are the tables r_localuserlist and adminsubnet b related? You
> are doing an unconstrained join here and I doubt that is what you
> want to do. Can you give us the table schema?
> 
> Jochem
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211181
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to