A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Duplication of information on some information



 
 
Thread Tools Display Modes
  #1  
Old November 21st, 2006, 10:36 PM posted to microsoft.public.access.queries
jrp444
external usenet poster
 
Posts: 36
Default Duplication of information on some information

When I run the below query I get duplicate information on some of the
accounts that it pulls up. Can anybody tell me what I need to do to stop
this duplication?

SELECT [RepoData Query].[C/O], [RepoData Query].LoanNumber, [RepoData
Query]![First Name] & ' ' & [RepoData Query]![Last Name] AS Name, [RepoData
Query]!Year & ' ' & [RepoData Query]![Vehicle Make /Collateral] & ' ' &
[RepoData Query]![Vehicle Model] AS Vehicle, [RepoData Query]!Date AS [Sales
Date], [RepoData Query].Auction, [RepoData Query].[Loan Bal], [RepoData
Query].[Floor Amt], [RepoData Query].[Sales Amount], [RepoData
Query].[Auction 1], [RepoData Query].[Auction Date 1], [RepoData Query].[High
Bid Amt 1], [RepoData Query].[Sold 1], [RepoData Query].[Auction 2],
[RepoData Query].[Auction Date 2], [RepoData Query].[High Bid Amt 2],
[RepoData Query].[Sold 2], [RepoData Query].[Auction 3], [RepoData
Query].[Auction Date 3], [RepoData Query].[High Bid Amt 3], [RepoData
Query].[Sold 3], [RepoData Query].[Floor Amt], [RepoData Query].[Vehicle
Value], [RepoData Query].Comments, [RepoData Query].[Dealer No], [RepoData
Query].Mileage, [RepoData Query].[Vehicle Condition], Dates.Date, Dates.Date1
FROM Dates, [RepoData Query]
WHERE ((([RepoData Query].[Sales Amount]) Is Not Null) AND (([RepoData
Query]![Date]) Between [Dates]![Date] And [Dates]![Date1]))
ORDER BY [RepoData Query].LoanNumber;

  #2  
Old November 22nd, 2006, 01:28 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Duplication of information on some information

Try adding DISTINCT to the query.

SELECT DISTINCT [RepoData Query].[C/O], ...

If that doesn't work, post back with an explanation as to the reason you are
using the Date table in your query. I'm guessing that it contains multiple
date ranges, but that is a guess. If it does contain multiple date ranges,
do any of the ranges overlap? If so, you could get duplicates returned
because a record falls into multiple ranges. Or you could have two ranges
entered that are identical in your Dates table.

If you have a RepoData record with a Date of 12/1/2005 and your Dates table
has two records with date and date1 fields of
11/1/2005 to 12/1/2005 and 12/1/2005 to 1/1/2006, that would cause the Repo
data to be returned twice for the record with a date of 12/1/2005


"jrp444" wrote in message
...
When I run the below query I get duplicate information on some of the
accounts that it pulls up. Can anybody tell me what I need to do to stop
this duplication?

SELECT [RepoData Query].[C/O], [RepoData Query].LoanNumber, [RepoData
Query]![First Name] & ' ' & [RepoData Query]![Last Name] AS Name,
[RepoData
Query]!Year & ' ' & [RepoData Query]![Vehicle Make /Collateral] & ' ' &
[RepoData Query]![Vehicle Model] AS Vehicle, [RepoData Query]!Date AS
[Sales
Date], [RepoData Query].Auction, [RepoData Query].[Loan Bal], [RepoData
Query].[Floor Amt], [RepoData Query].[Sales Amount], [RepoData
Query].[Auction 1], [RepoData Query].[Auction Date 1], [RepoData
Query].[High
Bid Amt 1], [RepoData Query].[Sold 1], [RepoData Query].[Auction 2],
[RepoData Query].[Auction Date 2], [RepoData Query].[High Bid Amt 2],
[RepoData Query].[Sold 2], [RepoData Query].[Auction 3], [RepoData
Query].[Auction Date 3], [RepoData Query].[High Bid Amt 3], [RepoData
Query].[Sold 3], [RepoData Query].[Floor Amt], [RepoData Query].[Vehicle
Value], [RepoData Query].Comments, [RepoData Query].[Dealer No], [RepoData
Query].Mileage, [RepoData Query].[Vehicle Condition], Dates.Date,
Dates.Date1
FROM Dates, [RepoData Query]
WHERE ((([RepoData Query].[Sales Amount]) Is Not Null) AND (([RepoData
Query]![Date]) Between [Dates]![Date] And [Dates]![Date1]))
ORDER BY [RepoData Query].LoanNumber;



  #3  
Old November 22nd, 2006, 02:42 PM posted to microsoft.public.access.queries
jrp444
external usenet poster
 
Posts: 36
Default Duplication of information on some information

I added DISTINCT as you suggested, but still I get some duplications in the
data. The Date that you see in the query sets up a range. Date is the
beginning date and Dates1 is the ending date. I use it in my macros so they
can reset the date range of the information that they want.

"John Spencer" wrote:

Try adding DISTINCT to the query.

SELECT DISTINCT [RepoData Query].[C/O], ...

If that doesn't work, post back with an explanation as to the reason you are
using the Date table in your query. I'm guessing that it contains multiple
date ranges, but that is a guess. If it does contain multiple date ranges,
do any of the ranges overlap? If so, you could get duplicates returned
because a record falls into multiple ranges. Or you could have two ranges
entered that are identical in your Dates table.

If you have a RepoData record with a Date of 12/1/2005 and your Dates table
has two records with date and date1 fields of
11/1/2005 to 12/1/2005 and 12/1/2005 to 1/1/2006, that would cause the Repo
data to be returned twice for the record with a date of 12/1/2005


"jrp444" wrote in message
...
When I run the below query I get duplicate information on some of the
accounts that it pulls up. Can anybody tell me what I need to do to stop
this duplication?

SELECT [RepoData Query].[C/O], [RepoData Query].LoanNumber, [RepoData
Query]![First Name] & ' ' & [RepoData Query]![Last Name] AS Name,
[RepoData
Query]!Year & ' ' & [RepoData Query]![Vehicle Make /Collateral] & ' ' &
[RepoData Query]![Vehicle Model] AS Vehicle, [RepoData Query]!Date AS
[Sales
Date], [RepoData Query].Auction, [RepoData Query].[Loan Bal], [RepoData
Query].[Floor Amt], [RepoData Query].[Sales Amount], [RepoData
Query].[Auction 1], [RepoData Query].[Auction Date 1], [RepoData
Query].[High
Bid Amt 1], [RepoData Query].[Sold 1], [RepoData Query].[Auction 2],
[RepoData Query].[Auction Date 2], [RepoData Query].[High Bid Amt 2],
[RepoData Query].[Sold 2], [RepoData Query].[Auction 3], [RepoData
Query].[Auction Date 3], [RepoData Query].[High Bid Amt 3], [RepoData
Query].[Sold 3], [RepoData Query].[Floor Amt], [RepoData Query].[Vehicle
Value], [RepoData Query].Comments, [RepoData Query].[Dealer No], [RepoData
Query].Mileage, [RepoData Query].[Vehicle Condition], Dates.Date,
Dates.Date1
FROM Dates, [RepoData Query]
WHERE ((([RepoData Query].[Sales Amount]) Is Not Null) AND (([RepoData
Query]![Date]) Between [Dates]![Date] And [Dates]![Date1]))
ORDER BY [RepoData Query].LoanNumber;




  #4  
Old November 22nd, 2006, 03:40 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Duplication of information on some information

As a trouble shooting technique, remove the dates table from the query and
hard code the range. Do you still get duplicates? If so, then you need to
figure out what data is in RepoData that is causing the duplicate records.

Did you check and make sure you only have one record in the Dates table?


"jrp444" wrote in message
...
I added DISTINCT as you suggested, but still I get some duplications in the
data. The Date that you see in the query sets up a range. Date is the
beginning date and Dates1 is the ending date. I use it in my macros so
they
can reset the date range of the information that they want.

"John Spencer" wrote:

Try adding DISTINCT to the query.

SELECT DISTINCT [RepoData Query].[C/O], ...

If that doesn't work, post back with an explanation as to the reason you
are
using the Date table in your query. I'm guessing that it contains
multiple
date ranges, but that is a guess. If it does contain multiple date
ranges,
do any of the ranges overlap? If so, you could get duplicates returned
because a record falls into multiple ranges. Or you could have two
ranges
entered that are identical in your Dates table.

If you have a RepoData record with a Date of 12/1/2005 and your Dates
table
has two records with date and date1 fields of
11/1/2005 to 12/1/2005 and 12/1/2005 to 1/1/2006, that would cause the
Repo
data to be returned twice for the record with a date of 12/1/2005


"jrp444" wrote in message
...
When I run the below query I get duplicate information on some of the
accounts that it pulls up. Can anybody tell me what I need to do to
stop
this duplication?

SELECT [RepoData Query].[C/O], [RepoData Query].LoanNumber, [RepoData
Query]![First Name] & ' ' & [RepoData Query]![Last Name] AS Name,
[RepoData
Query]!Year & ' ' & [RepoData Query]![Vehicle Make /Collateral] & ' ' &
[RepoData Query]![Vehicle Model] AS Vehicle, [RepoData Query]!Date AS
[Sales
Date], [RepoData Query].Auction, [RepoData Query].[Loan Bal], [RepoData
Query].[Floor Amt], [RepoData Query].[Sales Amount], [RepoData
Query].[Auction 1], [RepoData Query].[Auction Date 1], [RepoData
Query].[High
Bid Amt 1], [RepoData Query].[Sold 1], [RepoData Query].[Auction 2],
[RepoData Query].[Auction Date 2], [RepoData Query].[High Bid Amt 2],
[RepoData Query].[Sold 2], [RepoData Query].[Auction 3], [RepoData
Query].[Auction Date 3], [RepoData Query].[High Bid Amt 3], [RepoData
Query].[Sold 3], [RepoData Query].[Floor Amt], [RepoData
Query].[Vehicle
Value], [RepoData Query].Comments, [RepoData Query].[Dealer No],
[RepoData
Query].Mileage, [RepoData Query].[Vehicle Condition], Dates.Date,
Dates.Date1
FROM Dates, [RepoData Query]
WHERE ((([RepoData Query].[Sales Amount]) Is Not Null) AND (([RepoData
Query]![Date]) Between [Dates]![Date] And [Dates]![Date1]))
ORDER BY [RepoData Query].LoanNumber;






  #5  
Old November 22nd, 2006, 04:41 PM posted to microsoft.public.access.queries
jrp444
external usenet poster
 
Posts: 36
Default Duplication of information on some information

It was the Date table that was causing the problem. I had more than one date
in the table. For some reason it had not cleared itself out during the
delete process. Thanks, I do appreciate all the help.

"John Spencer" wrote:

As a trouble shooting technique, remove the dates table from the query and
hard code the range. Do you still get duplicates? If so, then you need to
figure out what data is in RepoData that is causing the duplicate records.

Did you check and make sure you only have one record in the Dates table?


"jrp444" wrote in message
...
I added DISTINCT as you suggested, but still I get some duplications in the
data. The Date that you see in the query sets up a range. Date is the
beginning date and Dates1 is the ending date. I use it in my macros so
they
can reset the date range of the information that they want.

"John Spencer" wrote:

Try adding DISTINCT to the query.

SELECT DISTINCT [RepoData Query].[C/O], ...

If that doesn't work, post back with an explanation as to the reason you
are
using the Date table in your query. I'm guessing that it contains
multiple
date ranges, but that is a guess. If it does contain multiple date
ranges,
do any of the ranges overlap? If so, you could get duplicates returned
because a record falls into multiple ranges. Or you could have two
ranges
entered that are identical in your Dates table.

If you have a RepoData record with a Date of 12/1/2005 and your Dates
table
has two records with date and date1 fields of
11/1/2005 to 12/1/2005 and 12/1/2005 to 1/1/2006, that would cause the
Repo
data to be returned twice for the record with a date of 12/1/2005


"jrp444" wrote in message
...
When I run the below query I get duplicate information on some of the
accounts that it pulls up. Can anybody tell me what I need to do to
stop
this duplication?

SELECT [RepoData Query].[C/O], [RepoData Query].LoanNumber, [RepoData
Query]![First Name] & ' ' & [RepoData Query]![Last Name] AS Name,
[RepoData
Query]!Year & ' ' & [RepoData Query]![Vehicle Make /Collateral] & ' ' &
[RepoData Query]![Vehicle Model] AS Vehicle, [RepoData Query]!Date AS
[Sales
Date], [RepoData Query].Auction, [RepoData Query].[Loan Bal], [RepoData
Query].[Floor Amt], [RepoData Query].[Sales Amount], [RepoData
Query].[Auction 1], [RepoData Query].[Auction Date 1], [RepoData
Query].[High
Bid Amt 1], [RepoData Query].[Sold 1], [RepoData Query].[Auction 2],
[RepoData Query].[Auction Date 2], [RepoData Query].[High Bid Amt 2],
[RepoData Query].[Sold 2], [RepoData Query].[Auction 3], [RepoData
Query].[Auction Date 3], [RepoData Query].[High Bid Amt 3], [RepoData
Query].[Sold 3], [RepoData Query].[Floor Amt], [RepoData
Query].[Vehicle
Value], [RepoData Query].Comments, [RepoData Query].[Dealer No],
[RepoData
Query].Mileage, [RepoData Query].[Vehicle Condition], Dates.Date,
Dates.Date1
FROM Dates, [RepoData Query]
WHERE ((([RepoData Query].[Sales Amount]) Is Not Null) AND (([RepoData
Query]![Date]) Between [Dates]![Date] And [Dates]![Date1]))
ORDER BY [RepoData Query].LoanNumber;







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.