Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Problem with Table Join Post Reply Post New Topic
Author Message
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Topic: Problem with Table Join
    Posted: 07 Nov 2012 at 11:28am
I have a problem with a table join (I think) and I'm not certain how to resolve it. I'm currently using an Inner Join. (I have other joins with no success).

Table A {oep70) = Invoice Details
Table B {slp20}= Payment Details

My report calculates sales commission on invoices based on details in the payment table (date paid, amount paid, etc). The invoice number in Table A equals a reference field in Table B.

{oep70.invn70}={slp20.lref20} except in one specific case...

When the customer is given Extended Terms on an invoice (3 equal payments for example), the field in {slp20.lref20} changes. If you take the invoice number 116942...

It's 116942 in {oep70} and 116942A, 116942B, and 116942C in {slp20}.

I'm not picking up any of the payments made against the Extended Terms invoices because their reference doesn't match the invoice number in {oep70}. They are being excluded altogether.

In my formulas, I have changed {oep70.invn70}={slp20.lref20} to {oep70.invn70}=(left({slp20.lref20},6)) but it's still not picking up the payments.

Any ideas? I cannot find any other unique way to join the tables together...

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Nov 2012 at 12:02pm
you will have to make the change in a command (or stored proc) on the joined field, not in a formula field after the join has already happened
IP IP Logged
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Posted: 08 Nov 2012 at 5:21am
Thanks, DBlank.

I know next to nothing about stored procedures so it looks like I've got a little research to do.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2012 at 5:33am
there also might be a 3rd table in your sytem that is the intermediate table that already 'translates' this join for you without any coding. I would think it would be rare for that not to exist if it is a standard process in your production site to mark the records with the number + A,B,C nomenclature.
Just a thought.
IP IP Logged
aeckaren
Newbie
Newbie
Avatar

Joined: 24 Jul 2012
Online Status: Offline
Posts: 26
Quote aeckaren Replybullet Posted: 09 Nov 2012 at 5:39am
I couldn't find a table that translates the join, but I was able to create a view and translate the join myself. Thanks for pointing me in the right direction!

Karen
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.