Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with a formula parameter please!!!

Status
Not open for further replies.

rgomez1999

Technical User
May 25, 2000
66
US
I've created a chart report based on an Access database that I'm using to enter currency and the dates bills were paid. I've been asked to produced charts on a monthly basis based on that billing month. I am using Crystal Reports v8.0. So far my charts look good. However, I need to insert a parameter that says, okay Robert I see you want to produce a report for what date period? My answer would be 01/01/2002 to 01/31/2002 and soon as I click okay I see graphs just for that period and not the past 3 months including January 2002 on the report.

I was informed that I should use this formula:

{History.Date} in {?DateRangeParameter} but this doesn't prompt me to enter a start date and an end date.

if someone can please tell me the exact correct formula I should be using I would be appreciative. HistoryDate is a field based on my Access Database.

Also, in my report with the chart, on top of the page I have the dates and the amounts billed but my dates are not in alpha order because they're not in alpha order in my access database. Is there a way I can have CR8.0 sort those dates for me on the report?

Thank You All!
 
you can try this:

history.date >= min(parameterdate) AND
history.date <= max(parameterdate)

but I don't like doing them this way - I'm set in my ways!
when I need to use a date parameter like that I create 2 separate parameters, one called @start_date and one called @end_date. then I set my record selection like this:

history_date >= @start_date AND
history_date <= @end_date

Ive found some glitches with using the min and max (above) but some people like it.

Now, for your sorting issue -

yes, you can create a group on that field (the date field) and set it to sort by that..

lmc
cryerlisa@hotmail.com
 
Did you create a date range parameter field and place the parameter object on the report? You must place the parameter object on the report somewhere, even if it is suppressed, in order for it to prompt you.

Then create a formula to display the records you selected:
totext(minimum({?daterange}))+&quot; to &quot;+totext(maximum({?daterange}))

Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
I'm trying both suggestions to no avail, would it be possible I could get a step-by-step instructions as to what to do.
 
if you want to save your report with some data and send me a copy via email I'd be happy to look at what you have and send you some step by step instructions - would that help?

lmc
cryerlisa@hotmail.com
 
It will be too hard for me to do that because the report is set to the database. I just need instructions on how to create these parameters and formulas that were suggested to me.

I tried both and when I check the x-2 box I get the error message of &quot;the remaining text does not appear to be part of the formula.&quot;
 
RGOMEZ--

when you save the report with data and send it to someone it doesnt matter if I have your database on my back end, I can still see what you are doing wrong with the report.

Anyway - step 1 - have you created your date parameters yet?

create one called @start_Date and set it as date, default it to whatever you prefer.

do the same with a second one, call this @end_date, and then set that to default to whatever you want.

go into your record selection and use this:

(
{history.date} >= @start_date AND
{history.date} <= @end_date
)

this will set your parameters and link them to your report selection criteria.

then go REFRESH the report, and you should get prompts to enter your @start_date and @end_date.

lmc
cryerlisa@hotmail.com

 
You can do this with just one parameter field, as long as you make it a RANGE parameter field. (Range parameters are effective in CR version 7)

Make your record selection formula: {history.date} in {?DateRangeParameter}


Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Thank you LMCryer I got it working with a few adjustments made to your record selection. However, is there a way I can hide the @start_date and the @end_date from appearing on the report? I noticed it in the preview where it shows as i.e. 12/1/2001 - 12/31/2001. Reason why I'm asking is because I already have the dates and the currency figures listed in the Group Header and Details section.

Thank you.

Rob
 
those have to be on the report for it to pull the right way but you can put them on the header and then condition those to suppress, they wont show on the report and they will still let you pull your info through.

just click on the parameter field, right click, format object, and take it from there.

glad it worked!

lmc
cryerlisa@hotmail.com
 
Actually, I don't think the parameter has to be on the report canvas at all. As long as the parameter is used in the selection formula correctly, you should be fine. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top