Mark Bakelaar
asked on
Select in select
Dear Experts,
I need to have a where statement similar to below, but I am not able to get it to work.
Can you please help me with this one.
Thanks, MB
DECLARE @UserName as varchar(59)
SET @UserName ='mb'
SELECT [UserID], [UserName], [FullName], [Password], [UserAccessID], [CompanyID], [UserRole] , [OwnCompanyID]
FROM [Users]
WHERE [CompanyID] = OwnCompanyID of @UserName
I need to have a where statement similar to below, but I am not able to get it to work.
Can you please help me with this one.
Thanks, MB
DECLARE @UserName as varchar(59)
SET @UserName ='mb'
SELECT [UserID], [UserName], [FullName], [Password], [UserAccessID], [CompanyID], [UserRole] , [OwnCompanyID]
FROM [Users]
WHERE [CompanyID] = OwnCompanyID of @UserName
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
But more safeOpen in new window