Results 1 to 3 of 3
  1. #1
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query to look for duplicate entries (2002)

    Why don't you use the Find Duplicate Query Wizard ?
    Francois

  2. #2
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Query to look for duplicate entries (2002)

    Edited by HansV to remove loads of unnecessary line ends/

    Hi,

    I am trying to build a query that will look to see if a duplicate day of service for a client has been entered. The query presently contains the following from the following tables:

    tblAccountDemographics.Account Name
    tblClientDemographics.Client Name
    tblEmployeDemographics.Employee Name
    tblTimeSheet.Date
    tblTimeSheet.Activity Legend
    tblTimeSheet.ActivityTime

    I need to be able to have the query look to see if a [client] has a duplicate [date] entered with the same [activity legend]. It is possible to have a duplicate date with different [activity legend] but not duplicate [date] with duplicate [activity legend]. I would like to use the query to show only clients who have duplicate [dates] with duplicata [activity legend] so the user doesn't have to run the query one client at a time. Is this even possible to do or is there a better approach? Here is the present SQL:

    SELECT tblAccountDemographics.[Account Name], tblClientDemographics.[Client Name], tblEmployee.[Employee Name], tblTimeSheet.Date, tblTimeSheet.[Activity Legend], tblTimeSheet.[Activity Time]
    FROM tblEmployee INNER JOIN (tblClientDemographics INNER JOIN (tblAccountDemographics INNER JOIN tblTimeSheet ON tblAccountDemographics.AccountID = tblTimeSheet.AccountId) ON tblClientDemographics.ID = tblTimeSheet.ClientID) ON tblEmployee.EmployeeNameID = tblTimeSheet.EmployeeID
    GROUP BY tblAccountDemographics.[Account Name], tblClientDemographics.[Client Name], tblEmployee.[Employee Name], tblTimeSheet.Date, tblTimeSheet.[Activity Legend], tblTimeSheet.[Activity Time]
    ORDER BY tblAccountDemographics.[Account Name];

    Thanks,
    Leesha

  3. #3
    Silver Lounger
    Join Date
    Jan 2002
    Posts
    1,615
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Query to look for duplicate entries (2002)

    MAJOR <img src=/S/blush.gif border=0 alt=blush width=15 height=15> !!!! I almost never use the queries these days except at times with reports due to the many cautions from this forum re potential problems. I don't know that I've ever used them with queries so I didn't even know this existed! This worked beautifully and did exactly what I hoped it would do.

    Thanks!

    Leesha

Posting Permissions

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