Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Using Or in a formula Post Reply Post New Topic
Author Message
mattb1126
Newbie
Newbie


Joined: 04 Oct 2012
Online Status: Offline
Posts: 4
Quote mattb1126 Replybullet Topic: Using Or in a formula
     Posted: 04 Oct 2012 at 3:16am
I'm brand new to Crystal and not sure how the formulas work. I need a report to be able to combine two different dates. I need the report to pick from "fundeddate" or "purchaseddate" it will be either of those not both so I just need and Or in my formula, just don't know how to do it.
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Oct 2012 at 3:17am
Is this in the selection criteria or in the data that displays on the report?
 
-Dell
IP IP Logged
mattb1126
Newbie
Newbie


Joined: 04 Oct 2012
Online Status: Offline
Posts: 4
Quote mattb1126 Replybullet Posted: 04 Oct 2012 at 3:19am
Both are in the selection criteria
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 04 Oct 2012 at 3:54am
Assuming that you have a parameter called {?Date} already set up:
 
1. Go to the Select Expert. 
2. If you haven't set anything yet, select one of the fields two fields, Is Equal To, the {?Date} parameter.
3. Click on the Formula button to show what you just created.
4. Click on Edit Formula.
5. Type " or ", add the second field = {?Date}.
6. If you have other selection criteria, be sure to surround this or statement with parentheses.
 
So, if you were adding your dates onto existing selection criteria, it would look something like this:
 
... and
({MyTable.fundeddate} = {?Date} or
  {MyTable.purchaseddate} = {?Date})
 
-Dell
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