-
[RESOLVED] Query Help
I'm filling a combobox with usernames to monitor calls, I'm now supposed to break it up into groups.
Select all from Empoyees where Group = (currentuser's group_
Basically, everyone is in a specific group. Whichever user is logged on I need to check which group they're in then use it as a parameter.
I know this gets the current user 'Thread.CurrentPrincipal.Identity.Name'
but i don't know how to check the table for their group.
-
Re: Query Help
You'll need to explain more about your database schema.
Do you just want something like this?
Code:
SELECT Group FROM Employees WHERE EmployeeID=@user
or:
Code:
SELECT * From Employees
WHERE Group=(
SELECT Group FROM Employees WHERE EmployeeID=@user
)
-
Re: Query Help
The Second one was exactly what I was looking for. Substring huh. Thanks man.