Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Unexplained record dropping Post Reply Post New Topic
Author Message
joewp
Newbie
Newbie


Joined: 24 Apr 2009
Online Status: Offline
Posts: 1
Quote joewp Replybullet Topic: Unexplained record dropping
     Posted: 04 May 2009 at 6:57am
Hi, this is my first post. I used to use Crystal back in the '90s and early 00's, but I'm getting back into it again in the last month or so. It's much better now!

I'm getting done what I need to, but I ran across a couple of wierdnesses I'd like to get explained if possible. I have a report that included this formula:

if (instr({i_mst.descr}, "C-2") > 0 Or instr({i_mst.descr-2}, "C-2") > 0 or
    instr({i_mst.descr}, "C-3") > 0 Or instr({i_mst.descr-2}, "C-3") > 0 or
    instr({i_mst.descr}, "C-4") > 0 Or instr({i_mst.descr-2}, "C-4") > 0 or
    instr({i_mst.descr}, "C-5") > 0 Or instr({i_mst.descr-2}, "C-5") > 0)
      
    then Control := "***Control***";


Unfortunately, "C-n" was also used for sutures, so they came out on the report looking like controlled substances. I changed the formula to this

if (instr({i_mst.descr}, "C-2") > 0 Or instr({i_mst.descr-2}, "C-2") > 0 or
    instr({i_mst.descr}, "C-3") > 0 Or instr({i_mst.descr-2}, "C-3") > 0 or
    instr({i_mst.descr}, "C-4") > 0 Or instr({i_mst.descr-2}, "C-4") > 0 or
    instr({i_mst.descr}, "C-5") > 0 Or instr({i_mst.descr-2}, "C-5") > 0)  and
    (instr({c_shipto.ship#}, "DEA") > 0 or instr({c_shipto.ship#}, "DE1") > 0)
      
    then Control := "***Control***";


but I found that Crystal was dropping records from my control table while producing the report, so I changed it to look for "SUTURE" in the description and all is well.

My question is, why would using a field from another table (one that I was already using in the report) cause me to lose records from the table I'm keying off of? This is a Progress database going through their ODBC SQL-92 driver.

Thanks in advance for any insight I can get here.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 May 2009 at 12:05pm

Hard to tell without seeing the data. My guess is the AND statement across tables either changed this from a left join to an inner join or there are records that met your first condition from the description table that did not meet  the AND condition from the shipto table. The statement did not account for NULLS or " ".



Edited by DBlank - 04 May 2009 at 12:28pm
IP IP Logged
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