How do I print date range selected in Crystal Report 8.5 Select Expert

I am trying to print the date range selected in Select Expert in my Report Heading.  I placed the database fields in the Report Header, but it does not display the range I selected. The report results are accurate for the date range I selected.
sapgonzalezAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LinInDenverCommented:
If you did a date range parameter (allow range)

try

Minimum( {?DateRangeParam} ) & ' to ' & Maximum( {?DateRangeParam} )
0
sapgonzalezAuthor Commented:
I just set up parameters and I can get the date range to print correctly in report title, but the date range does not match the dates used in Report Select.  I modified the formula as follows:

{periodt.pebedt} >= DateTime (?Begin Date) and
{periodt.peendt} <= DateTime (?End Date)

I would like to be able to use this link between parameter and table.field.  Is this possible?
0
LinInDenverCommented:
can you show me what your original formula looked like (that returned the data the way you wanted)? two date fields can be tricky!
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

sapgonzalezAuthor Commented:
{periodt.peendt} <= DateTime (2009, 12, 31, 00, 00, 00) and
{periodt.pebedt} >= DateTime (2008, 01, 01, 00, 00, 00)
0
LinInDenverCommented:
Thanks!
Does this fix it?

date({periodt.pebedt}) >= Date (?Begin Date) and
date({periodt.peendt}) <= Date (?End Date)

If your periods are always at "midnight" convert both to dates instead of datetime for your comparison.
0
sapgonzalezAuthor Commented:
I need to link parameters ?Begin Date to periodt.pebedt and ?End Date to periodt.peendt - is there a way to do this in Crystal?
0
LinInDenverCommented:
Does that mean my last post didn't work? If not, I'm not sure how your original formula was working.

I believe the only way to do this is through your join (your select expert).

if you were to link them it would make the select expert this way - equal instead of >= <=

date({periodt.pebedt}) = Date (?Begin Date) and
date({periodt.peendt}) = Date (?End Date)
0
sapgonzalezAuthor Commented:
When I use this format
date({periodt.pebedt}) = Date (?Begin Date) and
date({periodt.peendt}) = Date (?End Date)

I receive error message, "The ) is missing".  I have tried placing ")" at end and I still receive error message.
0
LinInDenverCommented:
if you just typed in ?Begin Date, it won't work. it needs to have brackets (this makes it an actual report field and not just text).

i still believe this is the code you need to use (with the >= and <= )

date( {periodt.pebedt} ) >= Date ( {?Begin Date} )  
and
date( {periodt.peendt} ) <=  Date ( {?End Date} )
0
sapgonzalezAuthor Commented:
Now, I receive a "A date-time is required here." error message.
0
LinInDenverCommented:
Okay, this means either your database fields or your parameter are Date type already, instead of DateTime

option #1
( {periodt.pebedt} ) >= Date ( {?Begin Date} )  
and
( {periodt.peendt} ) <=  Date ( {?End Date} )

option #2
date( {periodt.pebedt} ) >= ( {?Begin Date} )  
and
date( {periodt.peendt} ) <= ( {?End Date} )
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sapgonzalezAuthor Commented:
Option # 2 worked - wow, thank you very much for your patience and hard work!
0
sapgonzalezAuthor Commented:
Very patient and dedicated to helping me find a solution.
0
LinInDenverCommented:
no problem. glad we cracked the code. ;-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.