?
Solved

Date Picker Crystal Reports

Posted on 2010-11-16
11
Medium Priority
?
1,335 Views
Last Modified: 2012-05-10
Hi,

I am trying to create a field parameter in my Crystal Reports which will prompt the user to select dates within a date range. I then want the rest of the report to only show data that was added during those dates.

I have tried to do this but it is not filtering the data. Can anyone help? I don't get any error messages. But I just need to know the basics of creating this parameter.

Thanks
0
Comment
Question by:Dan560
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 8

Accepted Solution

by:
kingjely earned 1600 total points
ID: 34145658
go to Field Explorer.
go to Parameter Fields
Right click.

new..
give it a name
STARTDATE
make it data type - DATE in the drop down box.
Choose 'OK'

Repeat, but call this Parameter Field - ENDDATE

now go to REport, Select Expert
NEW.
Choose your 'datefield'
now choose 'is between' from the drop down box

and then choose
{?STARTDATE}  and {?ENDDATE}

Then refresh your report.

Thats the basics of it, and will do what you asked !

Hope it helps!
Kj



0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 400 total points
ID: 34145744
As above with one added comment..
You must make sure the parameter datatype is correctly specified - if your database field is Date datatype then the parameter must also be so; if the database field is datetime datatype then the parameter must also be so.
0
 
LVL 8

Expert Comment

by:kingjely
ID: 34145792

Hi Mr Peter!!
I though I mentioned that !?

>
give it a name
STARTDATE
make it data type - DATE in the drop down box   <=========

;)
0
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

 
LVL 8

Expert Comment

by:kingjely
ID: 34145807
Or you mean it could be Date time? maybe ? Okay ;)
0
 
LVL 2

Author Comment

by:Dan560
ID: 34145810
Thanks, my date parameter is in the following format - 04/11/2010 07:09:50
Will this work? Or do I need to create a formula to change the format?

Also if I open the report in crystal reports viewer will the user also get prompted for the date range options?
0
 
LVL 2

Author Comment

by:Dan560
ID: 34145834
Not date parameter... I meant that is the way the date is displayed within my table!
0
 
LVL 8

Expert Comment

by:kingjely
ID: 34145879
You mean your date filed is - 04/11/2010 07:09:50
Yea that will be fine,

when you refresh, you will be prompted for the 2 parameters you created,
{?STARTDATE} and {?ENDDATE} that you have appended to 'Yourdatetimefield'

As you selected in the select expert, 'Is Between' {?STARTDATE} and {?ENDDATE} then, whatever data falls with in the date range your users select when they are prompeted, these are the records that will be returned..

0
 
LVL 8

Expert Comment

by:kingjely
ID: 34145895
..   YourDateField' in your table ..  Yes :)
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34146035
Based on your example data then your parameter MUST be a datetime parameter NOT a Date parameter.
0
 
LVL 2

Author Comment

by:Dan560
ID: 34146413
Thanks I really appreicate the help.

Unfortunately it is not displaying any data.

In the record select statement I get an error saying "a date-time is required here".. so I'm thinking it must be the date format?



startdate.png
enddate.png
0
 
LVL 2

Author Comment

by:Dan560
ID: 34146520
It's working! Thanks
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question