Solved

Date Picker Crystal Reports

Posted on 2010-11-16
11
1,159 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
Comment Utility
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
Comment Utility
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
Comment Utility

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

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

;)
0
 
LVL 8

Expert Comment

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

Author Comment

by:Dan560
Comment Utility
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 2

Author Comment

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

Expert Comment

by:kingjely
Comment Utility
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
Comment Utility
..   YourDateField' in your table ..  Yes :)
0
 
LVL 77

Expert Comment

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

Author Comment

by:Dan560
Comment Utility
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
Comment Utility
It's working! Thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

763 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

8 Experts available now in Live!

Get 1:1 Help Now