Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...MSSQL Query - User ProfileMSSQL Query - User Profile
Previous
 
Next
New Post
2/23/2007 12:51 PM
 

I'm trying to run a sql query  from users and userprofile with the following result:

LastName | FirstName | City | Phone Number 

Smith    Joe    New York  (555)555-5555

This is what I have so far but it is not working out to well...

------------------------------------

SELECT Users.FirstName, Users.LastName, UserProfile.PropertyValue AS City, UserProfile.PropertyValue AS Phone
FROM Users, UserProfile WHERE Users.UserID = UserProfile.UserID AND UserProfile.PropertyDefinitionID = 27 AND UserProfile.PropertyDefinitionID = 31
ORDER BY Users.LastName

------------------------------------

 
New Post
2/27/2007 4:51 PM
 

I forgot to mention that I am using SQLGridSelectedView V4.0

 
New Post
3/1/2007 8:24 PM
 

What issues are you having?...   Also -- double check the hardcoded values you are using as they may have changed - especially if you have changed DNN databases.

Paul.

 
New Post
3/14/2007 11:54 AM
 

use this

 

SELECT     MAX(CASE WHEN propertyName = 'FirstName' THEN propertyValue END) AS FirstName,
                      MAX(CASE WHEN propertyName = 'LastName' THEN propertyValue END) AS LastName,
                      MAX(CASE WHEN propertyName = 'Company Name' THEN propertyValue END) AS CompanyName,
                      MAX(CASE WHEN propertyName = 'City' THEN propertyValue END) AS City, MAX(CASE WHEN propertyName = 'State' THEN propertyValue END)
                      AS State, MAX(CASE WHEN propertyName = 'Country' THEN propertyValue END) AS Country,
                      MAX(CASE WHEN propertyName = 'Postalcode' THEN propertyValue END) AS Postalcode,
                      MAX(CASE WHEN propertyName = 'telephone' THEN propertyValue END) AS Phone, UserRoles.RoleID, Roles.RoleName, Users.Email
FROM         (SELECT DISTINCT PropertyName, PropertyValue, UserID
                       FROM          ProfilePropertyDefinition AS ppd INNER JOIN
                                              UserProfile AS up ON up.PropertyDefinitionID = ppd.PropertyDefinitionID) d INNER JOIN
                      UserRoles ON d.UserID = UserRoles.UserID INNER JOIN
                      Users ON UserRoles.UserID = Users.UserID INNER JOIN
                      Roles ON UserRoles.RoleID = Roles.RoleID

GROUP BY d.UserID, UserRoles.RoleID, Users.Email, Roles.RoleName
ORDER BY UserRoles.RoleID

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...MSSQL Query - User ProfileMSSQL Query - User Profile


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out