Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Crystal Reports Record Selection Formula Based on Two Date Fields

Posted on 2010-08-19
4
Medium Priority
?
928 Views
Last Modified: 2012-05-10
Hello Experts,

I am working on a report (Crystal Reports version 11), that uses a global date parameter to link multiple subreports.  When I run the report I enter a single date range and each subreport has the following in its record selection:
{MManpower.M_tTime} >= {?Pm-@Begin Range} and
{MManpower.M_tTime} <= {?Pm-@End Range}

My quandary is that I am trying to add a second date condition in the record selection using the following syntax:
(({MManpower.M_tTime} >= {?Pm-@Begin Range} and
{MManpower.M_tTime} <= {?Pm-@End Range})
or
({IIncident.I_tTimeTransmit} >= {?Pm-@Begin Range} and
{IIncident.I_tTimeTransmit} <= {?Pm-@End Range}))

But, I am not getting records back that are based on the second table.date field - I am only getting records back based on the first table.field.  Is this because the subreport link in the primary report is based on only the first table.field?  If so, is there a way to link the global date parameter in the subreport links to more than one table.field?  Or, is my syntax incorrect? Or do I need a different work-around?

Thank you for your help with this.
~Chopp
0
Comment
Question by:Chopp
[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
4 Comments
 
LVL 8

Accepted Solution

by:
kingjely earned 668 total points
ID: 33475277
Do you need OR, or AND as the operator here?

Do both date conditions need to be met in the subreport(only) OR both ?

(({MManpower.M_tTime} >= {?Pm-@Begin Range} and
{MManpower.M_tTime} <= {?Pm-@End Range})
or
({IIncident.I_tTimeTransmit} >= {?Pm-@Begin Range} and
{IIncident.I_tTimeTransmit} <= {?Pm-@End Range}))
0
 
LVL 11

Assisted Solution

by:tickett
tickett earned 668 total points
ID: 33478033
Yes- be careful about grouping AND/OR statements.

Instead of {table.timeField} <= {?begin} and {table.timeField} >= {?end} you could do:

{table.timeField} in {?begin} to {?end}

Would neaten things up a little.

L
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 664 total points
ID: 33482307
If this is in the subreport then just change the selection formula to reflect using both fields.

mlmcc
0
 

Author Closing Comment

by:Chopp
ID: 33513016
Thank you, Experts.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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