Solved

Date Picker Crystal Reports

Posted on 2010-11-16
11
1,220 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

830 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