Hi,
I have a query that returns on or tw records. If two, the report is OK, each record is shown (by EAN). With one record, I also get two records in the details section, duplicates. This messes up totals of course. I fail to understand how this is possible, anybody got a clue?
The report is not using any grouping or sorting.
I'll post the SQL, but doubt that the problem lies there.
Any help would be appreciated.
The sql is passthrough to Oracle:
EasyIT
"Do you think that’s air you're breathing?
I have a query that returns on or tw records. If two, the report is OK, each record is shown (by EAN). With one record, I also get two records in the details section, duplicates. This messes up totals of course. I fail to understand how this is possible, anybody got a clue?
The report is not using any grouping or sorting.
I'll post the SQL, but doubt that the problem lies there.
Any help would be appreciated.
The sql is passthrough to Oracle:
Code:
SELECT
NM_ADMIN.TSI_ACCOUNT.NAME,
NM_ADMIN.TSI_ACCOUNT.LOCATION AS Klantnummer,
NM_ADMIN.TSI_QUOTEITEMXA.TEXT_VALUE,
NM_ADMIN.TSI_ASSETMGMTASSET.NUON_EAN_CODE,
NM_NUTS.NHP_INVOICEDETAILS.INVOICEPERIOD,
to_char (NM_NUTS.NHP_INVOICEDETAILS.INVOICEPERIOD) AS FACTUURPERIODE,
NM_NUTS.NHP_INVOICEDETAILS.APX_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.APX_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.APX_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.APX_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.OTC_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.OTC_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.OTC_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.OTC_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.ONB_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.ONB_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.ONB_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.ONB_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.LDNVOLUME,
NM_NUTS.NHP_INVOICEDETAILS.ODNVOLUME,
NM_NUTS.NSP_CONNECTION.FK_LOCATION
FROM NM_NUTS.NSP_CONNECTION, NM_NUTS.NHP_INVOICEDETAILS
INNER JOIN(NM_ADMIN.TSI_QUOTEITEMXA
INNER JOIN(NM_ADMIN.TSI_QUOTEITEM
INNER JOIN(NM_ADMIN.TSI_QUOTE
INNER JOIN(NM_ADMIN.TSI_ACCOUNT
INNER JOIN(NM_ADMIN.TSI_ASSETMGMTASSET
INNER JOIN NM_ADMIN.TSI_ASSETPROFHEADER
ON NM_ADMIN.TSI_ASSETMGMTASSET.NR =
NM_ADMIN.TSI_ASSETPROFHEADER.ASSETID) ON NM_ADMIN.TSI_ACCOUNT.NR = NM_ADMIN.TSI_ASSETPROFHEADER.ACCOUNTID) ON NM_ADMIN.TSI_QUOTE.ACCOUNTID = NM_ADMIN.TSI_ACCOUNT.NR) ON NM_ADMIN.TSI_QUOTEITEM.QUOTE_ID = NM_ADMIN.TSI_QUOTE.NR) ON NM_ADMIN.TSI_QUOTEITEMXA.QUOTE_ITEM_ID = NM_ADMIN.TSI_QUOTEITEM.NR) ON NM_NUTS.NHP_INVOICEDETAILS.EAN = NM_ADMIN.TSI_ASSETMGMTASSET.NUON_EAN_CODE
WHERE NM_ADMIN.TSI_QUOTEITEMXA.NAME = 'Fixed Fee' AND
NM_ADMIN.TSI_QUOTE.STATUS = 'Contract Active' AND
NM_NUTS.NSP_CONNECTION.EANCODE = NM_ADMIN.TSI_ASSETMGMTASSET.NUON_EAN_CODE
AND FK_LOCATION = '567'
AND INVOICEPERIOD = '201305'
GROUP BY
NM_ADMIN.TSI_ACCOUNT.NAME,
NM_ADMIN.TSI_ACCOUNT.LOCATION,
NM_ADMIN.TSI_QUOTEITEMXA.TEXT_VALUE,
NM_ADMIN.TSI_ASSETMGMTASSET.NUON_EAN_CODE,
NM_NUTS.NHP_INVOICEDETAILS.INVOICEPERIOD,
To_CHAR(NM_NUTS.NHP_INVOICEDETAILS.INVOICEPERIOD),
NM_NUTS.NHP_INVOICEDETAILS.APX_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.APX_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.APX_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.APX_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.OTC_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.OTC_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.OTC_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.OTC_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.ONB_LDN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.ONB_LDN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.ONB_ODN_AMT,
NM_NUTS.NHP_INVOICEDETAILS.ONB_ODN_VOL,
NM_NUTS.NHP_INVOICEDETAILS.LDNVOLUME,
NM_NUTS.NHP_INVOICEDETAILS.ODNVOLUME,
NM_NUTS.NSP_CONNECTION.FK_LOCATION
ORDER BY NM_ADMIN.TSI_ASSETMGMTASSET.NUON_EAN_CODE,
NM_NUTS.NHP_INVOICEDETAILS.INVOICEPERIOD DESC;
EasyIT
"Do you think that’s air you're breathing?