Allow Duplicate Entries in Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AccessUser123
    New Member
    • Apr 2010
    • 5

    Allow Duplicate Entries in Access

    I am trying to get my Access database to INCLUDE duplicate records. I have a simple database with one table that does not have a primary key and I am using one query to generate a report. The data has a lot of duplicate records that need to be included in my report. Is there a way to include duplicate records so that they will show on my report. All table fields that are indexed are set to "Yes, Duplicates OK" and all fields in the report have "no" in the Hide Duplicates field on the property sheet.
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Unless your using some sort of grouping in your report or query or possible some criteria not including null fields, they should allready show. What is the SQL syntax of your query?

    Comment

    • AccessUser123
      New Member
      • Apr 2010
      • 5

      #3
      Sql

      Code:
      SELECT   [Labor List].Clock,
               [Labor List].Name,
               [Labor List].Department,
               [Labor List].[GL Account #],
               [Labor List].[Period Hours],
               [Labor List].[Period Gross],
               [Labor List].[PAY PERIOD],
               [Labor List].PSID,
               [Labor List].[Pay Rate]
      
      FROM     [Labor List]
      
      GROUP BY [Labor List].Clock,
               [Labor List].Name,
               [Labor List].Department,
               [Labor List].[GL Account #],
               [Labor List].[Period Hours],
               [Labor List].[Period Gross],
               [Labor List].[PAY PERIOD],
               [Labor List].PSID,
               [Labor List].[Pay Rate]
      
      HAVING   ((([Labor List].Department) Between [Beginning Dept] And [Ending Dept])
         AND   (([Labor List].[PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
         AND   (([Labor List].PSID) Between [Beginning PSID] And [Ending PSID]))
          OR   ((([Labor List].Department) Between [Beginning Dept] And [Ending Dept])
         AND   (([Labor List].[PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
         AND   (([Labor List].PSID) Between [Beginning PSID] And [Ending PSID]))
      
      ORDER BY [Labor List].Department,
               [Labor List].[GL Account #];
      Last edited by NeoPa; May 10 '10, 02:13 PM. Reason: Please use the [CODE] tags provided.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        If that's what you want, why are you using a GROUP BY query?

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32633

          #5
          As a very basic first suggestion I would say try :
          Code:
          SELECT   Clock,
                   Name,
                   Department,
                   [GL Account #],
                   [Period Hours],
                   [Period Gross],
                   [PAY PERIOD],
                   PSID,
                   [Pay Rate]
          
          FROM     [Labor List]
          
          WHERE    (((Department) Between [Beginning Dept] And [Ending Dept])
            AND    (([PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
            AND    ((PSID) Between [Beginning PSID] And [Ending PSID]))
             OR    (((Department) Between [Beginning Dept] And [Ending Dept])
            AND    (([PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
            AND    ((PSID) Between [Beginning PSID] And [Ending PSID]))
          
          ORDER BY Department,
                   [GL Account #]

          Comment

          Working...