Hey Guys,
I need to produce another sql statement which displays users who have been assigned a custom role, similar to the statement below, however I was needing to display the following fields:
First Name, Last Name, Unit Number, Street, City, Region, Country, Post Code, Telephone, Email
SELECT U.Username, U.Firstname, U.Lastname, R.Rolename, AM.Email
FROM Users U
INNER JOIN UserRoles UR on U.Userid = UR.Userid
INNER JOIN Roles R on UR.Roleid = R.Roleid
INNER JOIN Aspnet_users AU on U.Username = AU.Username
INNER JOIN Aspnet_membership AM on AU.Userid = AM.Userid
WHERE R.Rolename = 'Registered Users'
Regards, Jay