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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Duplicate Data showing on Report



 
 
Thread Tools Display Modes
  #21  
Old April 30th, 2009, 08:34 PM posted to microsoft.public.access.reports
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Duplicate Data showing on Report

Am I supposed to take out the rest of the line so it only reads: FROM
JCHSTTRN, MultiRefNum ??

Yes. Then it would look like this --
.......JCHSTTRN.Documentnumber, JCHSTTRN.Transactionunits,
JCHSTTRN.Amt, MultiRefNum.Referencenumber
FROM JCHSTTRN, MultiRefNum
WHERE (((JCHSTTRN.Jcreference) .....

"Heather" wrote:

I don't understand what you mean...what's the FROM statement?

I can't get beyond the SQL view in my queries (it won't do anything but give
me an error message when I try to run it in the design view). When I take
out the LEFT JOIN to match what you have below (FROM JCHSTTRN, MultiRefNum),
Access highlights "ON" and gives me the error message I reported yesterday:
"Syntax error in FROM clause" and won't let me switch from SQL view to Design
view.

Am I supposed to take out the rest of the line so it only reads: FROM
JCHSTTRN, MultiRefNum ??

"KARL DEWEY" wrote:

I asked what was the results when you dropped the LEFT JOIN from the query as
I suggested?
Using the two tables like this ---
FROM JCHSTTRN, MultiRefNum

"Heather" wrote:

These are my two queries:

SELECT JCHSTTRN.Referencenumber, JCHSTTRN.Jcreference,
Count(JCHSTTRN.Referencenumber) AS CountRefNum
FROM JCHSTTRN
WHERE (((JCHSTTRN.Referencenumber)"1"))
GROUP BY JCHSTTRN.Referencenumber, JCHSTTRN.Jcreference;

and

SELECT DISTINCTROW JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate, JCHSTTRN.Unittype, JCHSTTRN.Description,
JCHSTTRN.Referencenumber, JCHSTTRN.Documentnumber, JCHSTTRN.Transactionunits,
JCHSTTRN.Amt, MultiRefNum.Referencenumber
FROM JCHSTTRN LEFT JOIN MultiRefNum ON JCHSTTRN.Referencenumber =
MultiRefNum.Referencenumber
WHERE (((JCHSTTRN.Jcreference) Not Like "*??????????3*" And
(JCHSTTRN.Jcreference) Not Like "??????????4") AND
((JCHSTTRN.Transactiondate)=#1/1/2008#) AND
((JCHSTTRN.Transactionunits)=IIf([MultiRefNum].[Referencenumber] Is Not
Null,"0","1") Or (JCHSTTRN.Transactionunits)="0"))
ORDER BY JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate;


"KARL DEWEY" wrote:

Post what you have in the FROM statement.

"Heather" wrote:

I get an error message that says "Syntax error in FROM clause"

"KARL DEWEY" wrote:

I've worked all day on it, trying to come up with something and I got
nothin'
I can not make any suggestions with that kind of comment.

What was the results when you dropped the LEFT JOIN from the query as I
suggested?

"Heather" wrote:

I'm still having a problem getting this to work! I've worked all day on
it, trying to come up with something and I got nothin'

"KARL DEWEY" wrote:

That error does not always mean 2 different types.

Try editing SQL from this --
FROM JCHSTTRN LEFT JOIN MultiRefNum ON JCHSTTRN.Referencenumber =
MultiRefNum.Referencenumber
WHERE (((JCHSTTRN.Jcreference) ......
to this --
FROM JCHSTTRN, MultiRefNum
WHERE (((JCHSTTRN.Jcreference) .....

Then try to run it. You will get a WHOLE LOT of records. If it runs
without error then complete the join in design view. Try running again.


"Heather" wrote:

I got the MultiRefNum query to work, but when I paste the info for the join
query into SQL, I'm getting an error upon running that says, "Data type
mismatch in criteria expression". I know that means somewhere, there is the
same data field but 2 different types. How do I figure out where and what?

"KARL DEWEY" wrote:

I posted eariler but to wrong thread.

Name this totals query MultiRefNum --
SELECT JCHSTTRN.Referencenumber, Count(JCHSTTRN.Referencenumber) AS
CountRefNum
FROM JCHSTTRN
WHERE Count(JCHSTTRN.Referencenumber) 1
GROUP BY JCHSTTRN.Referencenumber;

Your query joined with the query above --
SELECT DISTINCTROW JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate, JCHSTTRN.Unittype, JCHSTTRN.Description,
JCHSTTRN.Referencenumber, JCHSTTRN.Documentnumber, JCHSTTRN.Transactionunits,
JCHSTTRN.Amt, MultiRefNum.Referencenumber
FROM JCHSTTRN LEFT JOIN MultiRefNum ON JCHSTTRN.Referencenumber =
MultiRefNum.Referencenumber
WHERE (((JCHSTTRN.Jcreference) Not Like "*??????????3*" And
(JCHSTTRN.Jcreference) Not Like "??????????4") AND
((JCHSTTRN.Transactiondate)=#1/1/2008#) AND
((JCHSTTRN.Transactionunits)=IIf([MultiRefNum].[Referencenumber] Is Not
Null,"0","1") Or (JCHSTTRN.Transactionunits)="0"))
ORDER BY JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate;


"Heather" wrote:

SELECT DISTINCTROW JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate, JCHSTTRN.Unittype, JCHSTTRN.Description,
JCHSTTRN.Referencenumber, JCHSTTRN.Documentnumber, JCHSTTRN.Transactionunits,
JCHSTTRN.Amt
FROM JCHSTTRN
WHERE (((JCHSTTRN.Jcreference) Not Like "*??????????3*" And
(JCHSTTRN.Jcreference) Not Like "??????????4") AND
((JCHSTTRN.Transactiondate)=#1/1/2008#))
ORDER BY JCHSTTRN.Jcreference, JCHSTTRN.Jctransactiontype,
JCHSTTRN.Transactiondate;


Is this what you meant? Thanks for your help!

"KARL DEWEY" wrote:

Ok, if you will post your report query I will edit it so you only get the one
record.

"Heather" wrote:

Both records are being pulled from the same table. I'm actually using a
query for the report to narrow the information to a date range of 1/1/2008 to
present.

There is a field that distinguishes them...Transactionunit. It is a '1' for
the voucher and a '0' for the AP check.

"KARL DEWEY" wrote:

Does the report pull records from two tables are both records in one table?
If in one table are there other fields to distinguish them?

"Heather" wrote:

When we enter a voucher into our accounting system and enter the
corresponding project number, we create a record in Accounts Payable and a
record for that project in the Project Costing module. When we cut the AP
check, there is a second record created for the project. When the user runs
the project costing report, we get a report that looks like this:

Document Nr. Reference Nr. Date Description Amount

Where the document number is the AP check number and the reference number is
the voucher number. However, unless manually deleted from the system, the
voucher line item will also show on the report with the document and
reference numbers both showing the voucher number. For example,

Document Nr. Reference Nr. Date Description Amount
0109785 0109785 11/1/08 freight out 257.84 (this is
the voucher)
0050154 0109785 11/21/08 ABC Freight 257.84 (this is
the AP check)

On my Access Report (I have Access 2003), I would like to eliminate the
voucher line item and ONLY show the check (of course, only if the voucher has
been paid – this isn’t an issue if the voucher is unpaid). How would I
correctly used the Hide Duplicates property in the report or a Union query
(from my understanding, the Union query is designed to eliminate duplicate
records). I know I’d need to tell the report to compare the document and
reference numbers, but I’m not sure which is the best way to go.

Thank you!
Heather

 




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 05:45 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.