Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Record Selection Help Post Reply Post New Topic
Author Message
i3isking
Newbie
Newbie


Joined: 18 Jul 2010
Online Status: Offline
Posts: 2
Quote i3isking Replybullet Topic: Record Selection Help
     Posted: 18 Jul 2010 at 10:43am
Below is my Record Selection Formula:

({Table.Create Date} in LastFullMonth
or
{Table.Closed Date} in LastFullMonth)
and
({Table.Location_A} = "mrs-moe"
or
{Table.Location_B} = "mrs-moe")


The above formula is returning records for Location_A only while my intention is for it to return records whenever the string "mrs-moe" is matched.

If I put only one of the last two statements alone I would get the records for that statement.
For example if my formula was like this:

{Table.Create Date} in LastFullMonth
or
{Table.Closed Date} in LastFullMonth)
and
({Table.Location_A} = "mrs-moe")

I would get the records where Location_A = "mrs-moe"

Likewise if it was like this:

{Table.Create Date} in LastFullMonth
or
{Table.Closed Date} in LastFullMonth)
and
({Table.Location_B} = "mrs-moe")

I would get the records where Location_B = "mrs-moe"
So nothing wrong with my database and I'm sure I'm missing something in my logic here!

How can I get both while also matching the date criteria?
Please Help!!

Thanks
- MO
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 19 Jul 2010 at 3:19am
is either location a/b null when there is a value of mrs-moe....nulls are treated as errors, it seems, but not reported.
 
you might try something like:
local booleanvar mrsmoe:=false
if Not isnull({Table.Location_B}) AND {Table.Location_B}= "mrs-moe" then
  mrsmoe := true;
if Not isnull({Table.Location_a}) AND {Table.Location_a}= "mrs-moe" then
  mrsmoe := true;
 
if ({Table.Create Date} in LastFullMonth
or
{Table.Closed Date} in LastFullMonth) and mrsmoe then...
 
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 19 Jul 2010 at 3:36am
or change formula option from 'Use Null values' to 'Use Default Values for Nulls'
IP IP Logged
Pyrotecnix
Newbie
Newbie
Avatar

Joined: 24 Jun 2010
Online Status: Offline
Posts: 16
Quote Pyrotecnix Replybullet Posted: 19 Jul 2010 at 6:22am
Sounds like you may want to check your linking on your tables and change it from a Inner Join to a Outer Join and make sure your not enforcing the link. You can click right click on the link from the two different tables to change this..it may fix the problem I had a similar problem and didn't think about how I was viewing my tables. Also after changing the type of join I would turn on the change null to default in the report options.
Crystal Reports XI
IP IP Logged
i3isking
Newbie
Newbie


Joined: 18 Jul 2010
Online Status: Offline
Posts: 2
Quote i3isking Replybullet Posted: 19 Jul 2010 at 8:01pm
That really helps thanks a lot.
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