By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

Allow Duplicate Entries in Access

P: 5
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.
Apr 20 '10 #1
Share this Question
Share on Google+
4 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
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?
Apr 21 '10 #2

P: 5
Expand|Select|Wrap|Line Numbers
  1. SELECT   [Labor List].Clock,
  2.          [Labor List].Name,
  3.          [Labor List].Department,
  4.          [Labor List].[GL Account #],
  5.          [Labor List].[Period Hours],
  6.          [Labor List].[Period Gross],
  7.          [Labor List].[PAY PERIOD],
  8.          [Labor List].PSID,
  9.          [Labor List].[Pay Rate]
  10.  
  11. FROM     [Labor List]
  12.  
  13. GROUP BY [Labor List].Clock,
  14.          [Labor List].Name,
  15.          [Labor List].Department,
  16.          [Labor List].[GL Account #],
  17.          [Labor List].[Period Hours],
  18.          [Labor List].[Period Gross],
  19.          [Labor List].[PAY PERIOD],
  20.          [Labor List].PSID,
  21.          [Labor List].[Pay Rate]
  22.  
  23. HAVING   ((([Labor List].Department) Between [Beginning Dept] And [Ending Dept])
  24.    AND   (([Labor List].[PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
  25.    AND   (([Labor List].PSID) Between [Beginning PSID] And [Ending PSID]))
  26.     OR   ((([Labor List].Department) Between [Beginning Dept] And [Ending Dept])
  27.    AND   (([Labor List].[PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
  28.    AND   (([Labor List].PSID) Between [Beginning PSID] And [Ending PSID]))
  29.  
  30. ORDER BY [Labor List].Department,
  31.          [Labor List].[GL Account #];
May 10 '10 #3

NeoPa
Expert Mod 15k+
P: 31,769
If that's what you want, why are you using a GROUP BY query?
May 10 '10 #4

NeoPa
Expert Mod 15k+
P: 31,769
As a very basic first suggestion I would say try :
Expand|Select|Wrap|Line Numbers
  1. SELECT   Clock,
  2.          Name,
  3.          Department,
  4.          [GL Account #],
  5.          [Period Hours],
  6.          [Period Gross],
  7.          [PAY PERIOD],
  8.          PSID,
  9.          [Pay Rate]
  10.  
  11. FROM     [Labor List]
  12.  
  13. WHERE    (((Department) Between [Beginning Dept] And [Ending Dept])
  14.   AND    (([PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
  15.   AND    ((PSID) Between [Beginning PSID] And [Ending PSID]))
  16.    OR    (((Department) Between [Beginning Dept] And [Ending Dept])
  17.   AND    (([PAY PERIOD]) Between [Beginning Pay Period] And [Ending Pay Period])
  18.   AND    ((PSID) Between [Beginning PSID] And [Ending PSID]))
  19.  
  20. ORDER BY Department,
  21.          [GL Account #]
May 10 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.