Results 1 to 3 of 3

Thread: [RESOLVED] Query Help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    Iowa
    Posts
    298

    Resolved [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.

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    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
    )

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2007
    Location
    Iowa
    Posts
    298

    Re: Query Help

    The Second one was exactly what I was looking for. Substring huh. Thanks man.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width