Skip to Content

Crystal Reports: datetime data type with date parameter

I created a report that asks users to enter a date range. The date is actually in datetime format in the database, but in the report, the user enters the only date. This causes the report to miss some of the records. Is there a way to change the date format in the report, so that the report will not omit any data?

The query looks like this in the command (simplified version):

Select userName, ID, StartDate
From Table
Where StartDate between {?BeginDate} and {?EndDate}
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Jul 31, 2020 at 04:19 PM

    What type of database are you connecting to? I would use whatever syntax is applicable to that database to convert the field to a date in the where clause. In Oracle, it would look like this:

    Where Trunc(StartDate) between {?BeginDate} and {?EndDate}

    -Dell

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.