Solved

Date Picker Crystal Reports

Posted on 2010-11-16
11
1,196 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
  • 5
  • 4
  • 2
11 Comments
 
LVL 8

Accepted Solution

by:
kingjely earned 400 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 100 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now