SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Query all my users activites only

    This Query is returing all the Users information and more too much.
    I need to only return the information that is ispecfici within that date for that particular user not tons (1,000 of records) of data. It should only be maye hundreds. HELP ME WITH QUERY PLEASE....
    Query
    Code:
    SELECT DISTINCT 
                          dbo.UserInfo.tp_SiteID AS SiteID, dbo.UserInfo.tp_GUID AS GUID, dbo.UserInfo.tp_ID AS ID, dbo.UserInfo.tp_Deleted AS FilesDeleted, 
                          dbo.UserInfo.tp_Login, dbo.UserInfo.tp_Title AS Name, dbo.UserInfo.tp_Notes AS Extra, dbo.UserData.tp_Editor, 
                          dbo.UserData.tp_Modified AS DateModified, dbo.Docs.DirName, dbo.Docs.LeafName, dbo.Docs.ListId, dbo.Docs.Type, dbo.Docs.TimeLastModified, 
                          dbo.Docs.Extension
    FROM         dbo.Docs LEFT OUTER JOIN
                          dbo.UserData ON dbo.Docs.SiteId = dbo.UserData.tp_SiteId LEFT OUTER JOIN
                          dbo.UserInfo ON dbo.UserData.tp_SiteId = dbo.UserInfo.tp_SiteID
    WHERE     (dbo.UserInfo.tp_Login = 'HISNT\sfehn') AND (dbo.UserInfo.tp_GUID = dbo.UserInfo.tp_GUID) AND (dbo.UserData.tp_Modified BETWEEN 
                          '2008-01-01' AND '2008-04-04')

  2. #2
    SitePoint Wizard cmuench's Avatar
    Join Date
    Jul 2005
    Location
    At my computer
    Posts
    2,251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it might be that left outer join you got going on. Try a inner join.

  3. #3
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As you requested I have some data along with an image (sql_query_users.jpg) of the three tables the data is coming from.
    IMAGE: http://www.machristopher.com/sql_query_users.jpg


    Code:
    SiteID	LoginID	FilesDeleted	Login	Name	Extra	Author	DateModifiedLast	DirName	LeafName	TimeLastModified	CheckoutUserId	Type	Extension
    {557BB330-C6BF-4058-97F6-F469CABE7576}	301	0	HISNT\sfehn	sallyf		5	1/21/2008 17:38	sites/FA/ACS/Document Library	SC_Documentation	1/21/2008 17:38		1	
    {557BB330-C6BF-4058-97F6-F469CABE7576}	301	0	HISNT\sfehn	sallyf		5	1/21/2008 17:38	sites/FA/ACS/Document library/SC_Documentation	Admin_Documents	1/21/2008 17:38		1	
    {557BB330-C6BF-4058-97F6-F469CABE7576}	301	0	HISNT\sfehn	sallyf		5	1/21/2008 17:38	sites/FA/ACS/Document library/SC_Documentation	Methodology	1/21/2008 17:38		1	
    {557BB330-C6BF-4058-97F6-F469CABE7576}	301	0	HISNT\sfehn	sallyf		5	1/21/2008 17:38	sites/FA/ACS/Document library/SC_Documentation	SharePoint_Site_Map	1/21/2008 17:38		1
    PLEASE HELP USSSSSSSSSSSSSS


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •