Solved

Parameter Fields - Date/Time to Date

Posted on 2011-02-28
4
357 Views
Last Modified: 2012-05-11
I need to filter my report by some date fields.  I created a parameter field for the database field and tried to select "Date" type.  However, when I fill in the rest of the info and click "Ok", then open it again, none of the info is retained.  Only if I set the type to "Date Time" will the parameter field work.

The problem is that, when the report gets diplayed and the prompt opens to enter or select the date(s), a time (0:00:00) is required to be typed in (or automatically added if the calendar is used).

How do I set it up so only a date is required?

TIA
0
Comment
Question by:Clif
  • 2
4 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35001416
You can use a date parameter.

WHat field are you comparing to?  What data type is it?

You can filter with a formulalike

Date({YourDateTimeField}) = {?Date1}

mlmcc
0
 
LVL 10

Author Comment

by:Clif
ID: 35001731
That's what I thought.  However, it doesn't appear to work.

The field is a SQL Server Datetime data type.

I create a new Parameter Field, type in it's name, select "Date" for the Type, select the proper field in the Value Field listbox, then I select "Allow range values" in the Options and click "Ok".

Reopening the Parameter Field with "Edit", the Value Field is set to "(None)"
0
 
LVL 12

Expert Comment

by:HugoHiasl
ID: 35001995
There is a problem with handling DateTime and Date types in Crystal Reports.

I would recommend creating a DATE parameter for nice entry. Use this parameter field in a formula field which converts the value to a DateTime field and use this formula as parameter for your query.

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35002763
Since the field type is really DATETIME I suspect Crystal doesn't maintain it.  That value in the parameter screen is only used to be able to load the values.

Are you using a dynamin or static parameter?

You can use parameters in the SELECT EXPERT to filter the data for the report.  

mlmcc
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

19 Experts available now in Live!

Get 1:1 Help Now