Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

How to Identify the Value of a Database Field in Crystal Reports that is an Integer as Even or Odd Number?

Hello Experts,

Is there a function or formula in Crystal Reports that can identify the value of a database field that is an integer, as an even or an odd number ?
My goal is to put all records with an odd 'case number' on the left side of my report and all the records with an even 'case number' on the right.  I am using two subreports to display the case number data in a group section.

Thank you.
~Chopp
0
Chopp
Asked:
Chopp
1 Solution
 
mlmccCommented:
Try this

OddNumber

{CaseNumberField} Mod 2 = 1

EvenNumber

{CaseNumberField} Mod 2 = 0

MOD gives the remainder when divided by in this case 2

mlmcc

0
 
ChoppAuthor Commented:
Thank you very much!  That works perfectly for my report.
Have a great evening.
~Chopp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now