Solved

zero records returned when start and end date are the same

Posted on 2012-04-05
3
289 Views
Last Modified: 2012-04-26
When I enter a date range that uses the same for start and end values I get zero records returned al though if I loo in the db I can find a few records that match that criteria.

When I look at the SQL query in Crystal, I see that the record selection date range changes, and the <= show only as < 

Seems this happens automatically on crystal.

How can I avoid that?

Thanks.
0
Comment
Question by:metropia
[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
3 Comments
 
LVL 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 166 total points
ID: 37813189
Use a stored procedure.

Also be aware of the times . . . if you have both start and end date @ 12:00 AM then it will only return anything that is exactly at that time.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 167 total points
ID: 37814682
Your records probably have a time associated with the date so you need to compare just the date or use

{DateField} >= {?DateParameter} AND {DateField} <= {?DateParameter} + 1

mlmcc
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 167 total points
ID: 37815185
Interesting point about the <= being changed to <.  That seems to just be the way that CR handles a <= datetime test.  In the query, it adds 1 second to the time and replaces the <= with <.  I don't know why it does that.  My best guess would be some kind of question/problem with precision, or something like that.  So it adds a second and uses < instead.  I don't know if it always does that.  It may depend on your datasource.  In my case I was using a test report that reads an Excel file.

 So
 1) I don't think there's anything you can do to avoid it.  _Maybe_ if you use a different datasource.  I kind of doubt that it would make any difference, but I can't rule it out.
 2) It shouldn't be a problem.  CR is adding 1 second, so the results should be the same.


 The most likely explanation for not finding the records would seem to be what the others suggested, that the times are not within your range.

 James
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

622 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