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