on 05-21-2013 4:05 AM
Hello All
I am having troubles creating a sales order and sales invoice. For whatever reason I get duplicate records when adding "Dscription" from RDR1 to the report. The key shared between RDR1 and ORDR is "DocEntry" Unfortunately I do not have access until Friday however I would like to go into work (work experience) with a rough idea of what is going wrong.
Tables used are RDR1, ORDR, OCRD
Report contains fields from ORDR and OCRD such as CardName, DocNum, Date etc field from RDR1 is Dscription which seems to be causing the problem. I have been able to suppress the duplicates using a formula however I cannot figure out a way to sum distinct records there must be a simpler way.
Sorry for the brief question, I do work exp once a week and dont have much time to research on site
Tried that Rafaee but it still returned duplicates. I think the reason behind this is that the Dscription could have 3 rows for a single DocEntry. I have another issue. I have moved on and am trying to do a basic Sales Order report but something is going wrong.
SELECT COUNT(DISTINCT T0.[DocNum]) AS 'Total Distinct Records Document Number' FROM [dbo].[ORDR] T0
^^ SAP Query showing that total number of distinct docnum within ORDR = 9315
SELECT "ORDR"."DocNum"
FROM "ACRODYNELIVE"."dbo"."ORDR" "ORDR"
^^ Crystal Query that also shows the total number or docnum being 9315
SELECT DISTINCT "OCRD"."CardCode", "ORDR"."DocNum", "ORDR"."DocDate", "ORDR"."VatSum", "ORDR"."DocTotal", "ORDR"."TotalExpns", "ORDR"."CardName"
FROM "GENERIC"."dbo"."OCRD" "OCRD" INNER JOIN "GENERIC"."dbo"."ORDR" "ORDR" ON ("OCRD"."CardCode"="ORDR"."CardCode") AND ("OCRD"."CardName"="ORDR"."CardName")
Report I generate within Crystal. There must be something filtering records as only 7315 are appearing.
Any idea what is causing this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Adam,
You want to say one doc have same item multiple time ?? Can you please share the top 10 results and a query you are executing ?
In which DB you are getting 9315 record is "ACRODYNELIVE" and which your are getting 7315 records is "GENERIC". Have you check this both DB have same records ??
Regards,
Rafaee M
Sorry I have made an error, i changed the name of the database to GENERIC as I didn't want to use the actual name. (pointless now)
Updated:
SELECT COUNT(DISTINCT T0.[DocNum]) AS 'Total Distinct Records Document Number' FROM [dbo].[ORDR] T0
^^ SQL Query (9315)
SELECT "ORDR"."DocNum"
FROM "GENERIC"."dbo"."ORDR" "ORDR
^^ Crystal Query (9315)
SELECT DISTINCT "OCRD"."CardCode", "ORDR"."DocNum", "ORDR"."DocDate", "ORDR"."VatSum", "ORDR"."DocTotal", "ORDR"."TotalExpns", "ORDR"."CardName"
FROM "GENERIC"."dbo"."OCRD" "OCRD" INNER JOIN "GENERIC"."dbo"."ORDR" "ORDR" ON ("OCRD"."CardCode"="ORDR"."CardCode") AND ("OCRD"."CardName"="ORDR"."CardName")
^^ Report I want to generate with incorrect results. (7315)
Hi Adam,
Check the Joins between the tables and see if that's causing the issue. Also, drag fields from all the tables to confirm if the records are really duplicate.
Just like you have suppress records when they're duplicate, there are ways to sum Distinct Records. Look for help on Running Totals in the CR designer.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Adam,
It would be great and easy if you paste your full query. And you can check is this the following joins in your query ?
ORDR INNER JOIN RDR1
ON ORDR.DocEntry = RDR1.DocEntry
INNER JOIN OCRD
ON ORDR.CardCode = OCRD.CardCode
Thanks.
Regards,
Rafaee M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.