Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

filter data based on userod and group membership??

Status
Not open for further replies.

sparkbyte

Technical User
Sep 20, 2002
879
US
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.

Code:
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.


Thanks

John Fuhrman
faq329-6766
thread329-1334328
thread329-1424438
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top