Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Prompt for Different Dates Post Reply Post New Topic
Author Message
jessiemacmillan
Newbie
Newbie
Avatar

Joined: 17 Apr 2008
Location: United States
Online Status: Offline
Posts: 18
Quote jessiemacmillan Replybullet Topic: Prompt for Different Dates
     Posted: 19 Aug 2008 at 1:36pm
I'm still learning the Crystal's lingo, so I'm not even sure how to ask this question.

Some of our reports are based on the date a case was opened. Others are based on the date a case was closed.

I'd live to create a parameter that lets the user decide whether to see data by open date or close date.

Is this even possible?

IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 19 Aug 2008 at 2:41pm

Yes, you got the lingo right.    However, what you want can't be done in the exact way you want. Each parameter in Crystal Reports must be entered by the user and they don't have any options for using on or the other. However, you could get around this problem by making one of the parameters ask the user for the type of date they want to enter (give it two defalut values of Open or Closed) and the second parameter is the date.

In your record selection fomrula, you will have to match the date to the proper field based upon what they entered in the first parameter. It would go something like this:
({?Type} = "Open" AND {?Date} = {table.OpenDate})
OR
({?Type} = "Closed" AND {?Date} = {table.CloseDate})
As you can see, the date that is used for comparison is based upon the Type parameter that you created with the two default values.
 
I think this will be what you need. If not, feel free to post a follow up with more details.
 
My Encyclopedia book gives you tutorials for learning how to create parameters and walks you through the steps of using them in your record selection formulas. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
jessiemacmillan
Newbie
Newbie
Avatar

Joined: 17 Apr 2008
Location: United States
Online Status: Offline
Posts: 18
Quote jessiemacmillan Replybullet Posted: 20 Aug 2008 at 7:06am
Thanks, Brian!   Clap   This is exactly what I needed. I'm used to finding similar workarounds in Access and other applications, so it makes perfect sense to me that this is the way to handle it.

Crystal Reports is powerful and I like what I can do with it, but it drives me crazy sometimes when it won't let me just drop some code in where I need it. I'm just enough of a programmer to write bits of code when I need to and I'm finding Crystal to be inscrutable sometimes.

Thanks again,
Jessie
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Aug 2008 at 2:02pm
I agree with your comments on Crystal. It is very powerful, but you really have to dig in to find out all its capabilities. I often hear people say that they hate Crystal because it doesn't do what they want it to do. But in reality it can do it, its just difficult to find out the how!
 
That's what I love about this forum. People around the world share their knowledge with everyone else so we can all learn from it. Very cool! Tongue


Edited by BrianBischof - 20 Aug 2008 at 2:03pm
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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