Solved

Parameter Fields - Date/Time to Date

Posted on 2011-02-28
4
361 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
[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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

732 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