Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

filter data based on userod and group membership??

filter data based on userod and group membership??

filter data based on userod and group membership??

I have a query that filters data by the current logged on users ID and I would like to add the ability to change the criteria if the user is a member of a AD group.


SELECT     ID, LoginID, ContactName, ContactPhone, ContactFax, OfficeCode, TypeOfContact, Digitized, RPCCode, ProgramName, AfileNumber, ReasonForCall,
                      ReceivedFile, StatusOfActivity, StartTimeDate, LoginIDClosed, ClosedTimeDate, Complex, Noncomplex, Track1, Track2, Track3, FileReviewButton,
                      AlienStatusButton, ApplStatusButton, RemovalDocsButton, PhotoOnlyButton, PrintOnlyButton, PhotosButton, PrintsButton, PhotosAndPrintsButton,
                      NatzCertButton, AffSupportButton, BondButton, FAXButton, ccMailButton, OtherButton, phonebutton, Photos3Button, Prints3Button, UpdatedCIS,
                      AFileCreate, BioDataButton, ResearchButton, FRCFileButton, FTFButton, ResponseMemo, LastDate, Project, Memo, Login1, Start1, End1, Login2,
                      Start2, End2, Login3, Start3, End3, StaffingSheetToggle, SEIPrint, StartTimeOnly, StartDateOnly, ClosedTimeOnly, DateOnly
FROM         dbo.Activity
WHERE     (PARSENAME(REPLACE(SUSER_SNAME(), '\', '.'), 1) = LoginID)

I am fairly sure it will have to be done within an IF statement but I am not sure how to do it.


John Fuhrman
FAQ329-6766: How do I connect users to specific remote printers?
thread329-1334328: VBscript using logparser to get eventLogs and load SQLdb.
thread329-1424438: Script for connecting to remote printers

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close