Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Help with mulit table report Post Reply Post New Topic
<< Prev Page  of 2
Author Message
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 07 Sep 2012 at 6:18am
Set the selection criteria to just this:
 
{TABLE1.DATE} in {?DATE START} to {?DATE END}
 
Don't worry about the name part of the filter yet.
 
-Dell
IP IP Logged
fuzzy ninja
Newbie
Newbie


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 9
Quote fuzzy ninja Replybullet Posted: 07 Sep 2012 at 6:23am
when I do that I get every record within that time frame from table1 only. 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 07 Sep 2012 at 6:39am
Are you displaying any Table2 data on the report?  If not, put a field or two on there for testing purposes.  After that, if you're just seeing the data from Table1 then there is something wrong with your join from Table1 to Table2.
 
If you can read SQL, I would then go to the Database menu and select "Show Query" to see the SQL that Crystal generates and try to find where the issue is.
 
-Dell
IP IP Logged
fuzzy ninja
Newbie
Newbie


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 9
Quote fuzzy ninja Replybullet Posted: 07 Sep 2012 at 6:49am
I added some table 2 fields as well.  I get data from both. 
IP IP Logged
fuzzy ninja
Newbie
Newbie


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 9
Quote fuzzy ninja Replybullet Posted: 07 Sep 2012 at 7:13am
I am having a smiler problem with a different report.  The second report only uses table1 which has two phone number fields. 

Table1.Phone1  and Table1.Phone2

I am trying to do an or search so it returns all records regardless what phone field the phone number was entered into.

({TABLE1.PHONE1} = {?Phone Number} OR
{TABLE1.PHONE2}= {?Phone Number})

The only records I get are ones that have the phone number in the phone1 field.  It appears that it searches and finds the records that are in the phone1 field but dosnt search phone2.  If I comment out the first line I get the records in phone2. If I comment out the second line I get the records in Phone1.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 07 Sep 2012 at 7:51am
I'm beginning to suspect that the problems with both reports are due to null values in the fields.
For the phone issue, try this:
 
(
(not IsNull({TABLE1.PHONE1}) and {TABLE1.PHONE1} = {?Phone Number})
or
(not IsNull({TABLE1.PHONE2}) and {TABLE1.PHONE2} = {?Phone Number})
)
 
For your other report, try this filter:
 
{TABLE1.DATE} in {?DATE START} to {?DATE END} and
(
(not IsNull({TABLE1.NAME}) and {TABLE1.NAME} startswith {?NAME})
or
(not IsNull({TABLE2.NAME}) and {TABLE2.NAME
} startswith {?NAME})
)
 
-Dell
IP IP Logged
fuzzy ninja
Newbie
Newbie


Joined: 05 Sep 2012
Location: United States
Online Status: Offline
Posts: 9
Quote fuzzy ninja Replybullet Posted: 07 Sep 2012 at 8:07am
Smile  YOU ARE A GENIUS! 

That worked perfectly! 

THANK YOU!
THANK YOU!
THANK YOU!


IP IP Logged
<< Prev Page  of 2
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.