Home
Crystal Reports Training
Crystal Reports XI
Crystal Reports .NET
Crystal Reports Forum
News
Tech Support
Active Topics
Memberlist
Search
Help
Register
Login
Technical Questions
Crystal Reports Forum
:
Crystal Reports 9 through 2022
:
Technical Questions
Topic: OR statement not working correctly
Author
Message
MrPozor
Newbie
Joined: 03 Feb 2012
Online Status: Offline
Posts: 2
Topic: OR statement not working correctly
Posted: 03 Feb 2012 at 4:08am
Hi,
I have a problem with an OR statement in Crystal Reports.
Basically I want to get a list of entries where either one of two checkboxes has been ticked.
I put the following into the record select:
{vPerson.pers_ma_1} = "Y" or {vPerson.pers_ma_2} = "Y"
but this does not list entries where ma_1="" and ma_2 ="Y"
If I reverse the formula, i.e.
{vPerson.pers_ma_2} = "Y" or {vPerson.pers_ma_1} = "Y"
I get the opposite, i.e. entries with ma_1="Y" and ma_2 ="" are missing.
Normally, for an OR statement the order of parameters should not matter, right? This is driving me insane!
Thanks for your help,
MrPozor
IP Logged
rkrowland
Senior Member
Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Posted: 03 Feb 2012 at 5:11am
Hmm that is weird...
You could try using a nested if statement rather than
or;
if
{vPerson.pers_ma_1} = "Y" then True else
if
{vPerson.pers_ma_2} = "Y" then True else False
Though I expect that would give the same results, maybe something to do with null fields but I can't say for certain.
Regards,
Ryan.
IP Logged
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Posted: 03 Feb 2012 at 5:18am
likely it is NULLs.
if Null is not accounted for in the set up or in the formula it stops evaluating the formula when it hits a null and returns no value for that row.
In the formula editor (for your OR formula) set the pick list option to use 'default vaues for nulls'
Edited by DBlank - 03 Feb 2012 at 5:19am
IP Logged
MrPozor
Newbie
Joined: 03 Feb 2012
Online Status: Offline
Posts: 2
Posted: 03 Feb 2012 at 5:24am
You were both right about the NULLs.
Using the 'default vaues for nulls' works perfectly!
Thanks a lot for your help.
Kind regards,
MrPozor
IP Logged
Printable version
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
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
HOME
|
FREE EBOOK
|
PROGRAMMING GUIDE
|
PURCHASE
|
REVIEWS
|
CONTACT ME
|
FAQ
|
LINKS
|
PRIVACY
|
CLICK PLAYS
|
BAEZL
© 2004-2026 Brian Bischof. All Rights Reserved.