473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Query returning duplicate records

Using Access 2000 - I have a query that is suppose to return the records from table [ Per Billable Log] within specified time range and find matching data from another table [ Clinician].

Table [Clinicians] houses Clinician name, location and rate information
Table [Per Billable Log] houses Clinician name, location and number of units for each type of service rendered on each day. The two tables are connected by field [ID]

Please see the code below
Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT [Per Billable Log].Clinician, [Per Billable Log].Location, [Per Billable Log].Date, [Per Billable Log].EmployeeType, [Per Billable Log].[Multiple Locations], [Per Billable Log].[DOC Intake], [Per Billable Log].[DOC FT], [Per Billable Log].[DOC IT-S], [Per Billable Log].[DOC IT], [Per Billable Log].[DOC TESTING], [Per Billable Log].[DOMHA Intake], [Per Billable Log].[DOMHA FT], [Per Billable Log].[DOMHA IT], [Per Billable Log].[DOMHA TESTING], [Per Billable Log].[EAP Intake], [Per Billable Log].[EAP FT], [Per Billable Log].[EAP IT-S], [Per Billable Log].[EAP IT], [Per Billable Log].[EAP Training], [Per Billable Log].[TDPRS TESTING], [Per Billable Log].[TDPRS Intake], [Per Billable Log].[TDPRS FT], [Per Billable Log].[TDPRS IT-S], [Per Billable Log].[Staff Training], [Per Billable Log].GAP, [Per Billable Log].[TRDPRS IT], [Per Billable Log].ID, Clinician.[$DOC Intake], Clinician.[$DOMHA Intake], Clinician.[$EAP Intake], Clinician.[$TDPRS Intake], Clinician.[$DOC FT], Clinician.[$DOMHA FT], Clinician.[$EAP FT], Clinician.[$TDPRS FT], Clinician.[$DOC IT-S], Clinician.[$DOMHA IT-S], Clinician.[$TDPRS IT-S], Clinician.[$EAP IT-S], Clinician.[$DOC TESTING], Clinician.[$DOMHA TESTING], Clinician.[$EAP Training], Clinician.[$Staff Training], Clinician.[$GAP], Clinician.[$EAP IT], Clinician.[$DOMHA IT], Clinician.[$DOC IT], Clinician.[$TDPRS IT], Clinician.[TDPRS TESTING], [Per Billable Log].[DOMHA IT-S]
  3. FROM Clinician, [Per Billable Log]
  4. WHERE ((([Per Billable Log].Date) Between forms![Report Date Range]![Beginning Date] And forms![Report Date Range]![Ending Date])); 
  5.  
I want the query to search for records in the [per billable log] table within the specified range and then return that record 1 time only and search the [clinician table ] for the rate information and return that as well.

My end goal is to use the query to build a report that would list the clinician's name in alpha order with his/her rates in the header area and in the footer list the service dates and types of service rendered for each day, then summing. It is returning the same record from [per billable log] 150 or so times in the query of which is causing a slight problem.

Any help offered would be greatly appreciated. Thanks so much!
Nov 28 '07 #1
5 8958
How are you joining the tables Clinician and [Per Billable Log]?
Nov 28 '07 #2
Per Billable Log.ProviderID joined to Clinician.ID

Does that answer your question?
Nov 28 '07 #3
After reading my initial posed questio.... I am left thinking you all have know idea what I am asking.

This is the problem ---- The query I built of which the code is listed above is running without any error messages, but it is returning the same exact record umpteen hundred times. I tried to change the group by and it is now returning 20 or so of the same exact record for the same date, same clinician when I run the query. I know that there is only one date for each clinician listed because the table is indexed to avoid duplicate entry for the same day.

Does that clarify my question? S.O.S. please help... I just cannot figure out why it not working.

Thanks again for any potential help or advice!

-Jennifer
Nov 29 '07 #4
I still need help with this issue.

As I am looking at the returned results more closely it is returning different information for the rates that are retrieved from clinician table. One individual doesn't even have rates listed in her record and in the 166 duplicate records returned it is showing various rates. Figuring that it is pulling it from the Clinician table, I must have something connected wrong, but don't know what.

Please help!!!!

Thank you in advance for any advice or right direction pointers.

-Jennifer
Nov 30 '07 #5
I figured out the issue. I didn't have the two ID Fields joined in the actual query. I only joined them in the table. The query is working fine now.
Nov 30 '07 #6

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

Similar topics

3
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: ...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
4
by: Trey | last post by:
How do I tell an update query to only search the records that are older then the current record? I need to figure out how to write a query that will take a record, look to see if any record...
1
by: G Gerard | last post by:
Hello I am trying to update a table (TableB) using records from a second table (TableA)
2
by: jmarr02s | last post by:
I don't know what I am doing wrong I get duplicate records when I query Here is my SQL query code: SELECT Utilization_T.Facid, Utilization_T.Year, Utilization_T.Beds, Utilization_T.LicBeds,...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
1
by: PerumalSamy | last post by:
Hi I am having table with more 13 lakhs records. I am having duplicate records in it. i need to remove that. I wrote the following query SELECT *
1
by: bcquadrant | last post by:
Hi there I am trying to make an update query that will update information in all occurances of duplicate records based on the First record for that duplicate set. There are about 30,000 records...
1
by: colin-whitehead | last post by:
I have 2 tables tblReports primary key UPN, plus numeric fields Effort, Attain, etc tblComments numeric primary key ID & textfield Text In the Query I select each record from tblReports...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.