Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula field as a Parameter, or another idea? Post Reply Post New Topic
Author Message
miamitourism
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 24
Quote miamitourism Replybullet Topic: Formula field as a Parameter, or another idea?
     Posted: 09 Jun 2011 at 8:29am
I have a column in my DB that has date values in DD/MM/YY HH:MM:SS format. I have formatted my report with an @DatePart formula that is returning a numeric "month" value only. For this report, I am only interested in the month value of a particular month, because leaving the data as is and using a select formula will cause the report to exclude records from previous years, which will not work.
 
The issue I am having is:  I want to be able to use a parameter where the user can choose the numeric number representing the month.
 
I am currently using a record select formula (in this example, I was looking for the month of May, hence the '5.00' which is referenced in the @DatePart formula).:
 
{cnt_Contacts.last_Name} <> "CONTACT" and
{cli_Clients.ip_status} in ["MEMBER", "NONMEMIP"] and
{cnt_Xref.Billing_Contact} and
{@ DatePart} = 5.00
 
My report is generating the correct results, and that's great, but I really would like to create a parameter where the user is prompted to select the "5.00" ("5") value. Any ideas?Lamp
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Jun 2011 at 8:42am

one way...

you can make a numeric param called month

set the min value to 1 and max value to 12


Edited by DBlank - 09 Jun 2011 at 8:43am
IP IP Logged
miamitourism
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 24
Quote miamitourism Replybullet Posted: 09 Jun 2011 at 8:48am
You make it sound so easy! It's these simple little things I always get stuck on. Thank you- that worked wonderfully!Clap
IP IP Logged
bobanna02
Newbie
Newbie


Joined: 03 Feb 2012
Online Status: Offline
Posts: 1
Quote bobanna02 Replybullet Posted: 03 Feb 2012 at 10:52am
I have a similar problem, but my formula is a little more complicated.  I have a formula looking at when an invoice was due versus when it was paid and providing a column of ON TIME, LATE, EARLY, MISSED DISCOUNT, etc. 

My users will want to report on exceptions only.  Is there a way to make that formula field into a parameter or filtered value on the report?
Example, only invoices paid early.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Feb 2012 at 12:56pm
You shouldbe able to make a dynamic parameter pointing to the formula field and then use that in the select expert.
Or you can create a static parameter with a lov that you desire and write your select statement to match the conditions.
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