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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header to be search criteria?

Status
Not open for further replies.

jwright12

Technical User
Oct 8, 2009
8
US
Hi,
I am very new to crystal so please be patient with me :) In my selection criteria I have choosen a date field that is between 7/1/03 and 6/30/04. I want the Page header to show that date range so that the person I am sending the report to know what dates are in the report (and I don't want to have to type it each time I change the dates). I did find a fomula that I put into the Format editor under display string and it gets me close. But it doesn't show the total date range. It will only show the first day that I have an entry for. Any help is very much appreciated !
Jodi

if HasLowerBound ({tblNotice.IntentFirstPub}) and HasUpperBound ({tblNotice.IntentFirstPub}) then

"Date Range:" + ToText(Minimum({tblNotice.IntentFirstPub}),"dd-MMM-yyyy") + " to " +

ToText(Maximum({tblNotice.IntentFirstPub}),"dd-MMM-yyyy")

Else if HasLowerBound ({tblNotice.IntentFirstPub}) then

"Date Range: After " + ToText(Minimum ({tblNotice.IntentFirstPub}),"dd-MMM-yyyy")

else "Date Range: Before " + ToText(Maximum({tblNotice.IntentFirstPub}),"dd-MMM-yyyy")
 
If you create a parameter {?DateRange} for your date range, you can replace your field in the formula above with {?DateRange} and it will work properly. Go into the field explorer->parameter->new and choose date as the datatype and set it to "allow range values". Then use the parameter in your record selection formula:

{table.date} = {?DateRange}

-LB


 
The only problem is that, it doesn't change my selection. I want it so that if I change the selection expert to select a new date range then it puts the new dates into the report.
 
You set your date field equal to {?DateRange} in the select expert--and then it does change the records AND you can use it in your formula.

-LB
 
Hey LB,
Why when I export to excel data only is the date range not showing up? I am getting some strange date. It is within the range but it is just a single date and not the original range I put in?
Thanks!
Jodi
 
I'm not following. If you have the correct data in the main report, the same data should appear in an export.

-LB
 
I know it is weird. The date range is not showing in the exported report but it is showing in the report in crystal? Gremlins.
 
I don't know what you mean by "the date range is not showing"--do you mean the records are outside of the date range or that your display formula which documents the date range used is not showing.

-LB
 
It is the latter. The display formulast which doucments the date range used is not showing - it is just showing one date, and it is neither the end point or the starting point of the range - it appears to be some arbitrary date in the middle.
 
In my selection expert I have

{tblNotice.IntentFirstPub} = {?DateRange}

And in my format editor I have

if HasLowerBound ({?DateRange}) and HasUpperBound ({?DateRange}) then

"Date Range:" + ToText(Minimum({?DateRange}),"dd-MMM-yyyy") + " to " +

ToText(Maximum({?DateRange}),"dd-MMM-yyyy")

Else if HasLowerBound ({?DateRange}) then

"Date Range: After " + ToText(Minimum({?DateRange}),"dd-MMM-yyyy")

else "Date Range: Before " + ToText(Maximum({?DateRange}),"dd-MMM-yyyy")
 
You mention the "format editor". This formula should be created in the field explorer->formula->new, not in a formatting area for some field. Once created, you would then drag it into the report header (I'm guessing).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top