Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

The best choice for your web site host, email hosting, and domain registration.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Biz Modules provides professional business modules and solutions for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Reports Module ...  Help with old users query?
Previous Previous
 
Next Next
New Post 3/22/2008 9:42 AM
Unresolved
User is offline Mike H
31 posts
10th Ranked


Help with old users query? 

I am a newbie who is totally lost

I am trying to write a report that would display "Full Name" "Email Address" "Last Login Date" and have only users that haven't login in the last 6 months show in the report.

Seems simple but boy have I gotten some funky things to appear.

Any Master willing to lend a hand?

 

Thanks,

Mike

 
New Post 3/22/2008 11:05 AM
User is offline workcontrol
124 posts
www.workcontrol.com
9th Ranked


Re: Help with old users query? 
Modified By workcontrol  on 3/22/2008 2:09:15 PM)

Try this

SELECT     u.FirstName, u.LastName, u.DisplayName, u.Email, am.LastLoginDate
FROM         {databaseOwner}{objectQualifier}aspnet_Membership AS am INNER JOIN
                      {databaseOwner}{objectQualifier}aspnet_Users AS au ON am.UserId = au.UserId INNER JOIN
                      {databaseOwner}{objectQualifier}Users AS u ON au.UserName = u.Username
WHERE     (am.LastLoginDate NOT BETWEEN DATEADD(month, - 6, GETDATE()) AND GETDATE())

I have sql black belt


Robert Tango
www.workcontrol.com
Custom Modules: UserManager|UserDirectory|UserImport|PortalSSO
 
New Post 3/23/2008 4:47 PM
User is offline Mike H
31 posts
10th Ranked


Re: Help with old users query? 

Big time thanks work!!!     Quick reply :)

Well it got me a heck of a lot closer than I was.......but....... It is listing the most recent logins.

In other words it listed everyone that logged in today and no one else.

What I was hoping to get was only people who's last login was older than 6 months ago from today.

Any thoughts?

 

Thanks again

Mike

 
New Post 3/27/2008 12:19 PM
User is offline Fuji Nguyen
192 posts
9th Ranked




Re: Help with old users query? 

Try this one

SELECT     u.FirstName, u.LastName, u.DisplayName, u.Email, am.LastLoginDate
FROM         {databaseOwner}{objectQualifier}aspnet_Membership AS am INNER JOIN
                      {databaseOwner}{objectQualifier}aspnet_Users AS au ON am.UserId = au.UserId INNER JOIN
                      {databaseOwner}{objectQualifier}Users AS u ON au.UserName = u.Username
WHERE

am.UserId NOT IN
(
SELECT UserId
FROM         {databaseOwner}{objectQualifier}aspnet_Membership
WHERE LastLoginDate BETWEEN DATEADD(month, - 6, GETDATE()) AND GETDATE()
)

This script is slight modification from Robert's script.  It gets all users and then excludes the accounts not login in the past 6 months (using sub query NOT IN)


Fuji Nguyen
FREE Visitor Hit Counter
Visit opensource.indyneinc.com for detail.
 
New Post 3/28/2008 8:05 PM
User is offline Mike H
31 posts
10th Ranked


Re: Help with old users query? 

OK I'm stumped

Each one of these scripts only gives me who logged on today. Now I did realize today after thinking about it that my site is in development so I don't have anyone that hasn't logged in for 6 months but I would think it would just make the grid empty. Right?

Maybe someone with a history that has user logins older than 6 months could try these scripts and see if they work for them?

Also I'm hosted on godaddy so I don't know if that would make a difference? Seems it has messed with me on some other database issues (permissions primarily).

Please let me any other ideas.

Thanks to all that have replied I really appreciate it!!!!

Mike

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Reports Module ...  Help with old users query?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Module Development by Engage Software
Specializing in custom module development, training and skinning.
www.engagesoftware.com
BataviaSoft DotNetNuke Solutions
BataviaSoft offers custom DotNetNuke solutions especially for the European and the South East Asian market.
www.bataviasoft.com
Viva Portals, L.L.C.
Expert module development and graphic design.
www.continure.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP