INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

duplicate in details section - but query has only one record??

duplicate in details section - but query has only one record??

duplicate in details section - but query has only one record??

(OP)
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:

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?"

RE: duplicate in details section - but query has only one record??

(OP)
Solved it...

Stupid me...

My query was the base of another that was the source for the report.


EasyIT

"Do you think that’s air you're breathing?"

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close