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
Solved

Grouping/Parameter Field issues - Crystal Reports 9

Posted on 2004-04-23
5
316 Views
Last Modified: 2012-06-21
I was tasked with creating a report for our company helpdesk.  This report is grouped by Completed and Pending tasks and filtered by a date range and location.  The date range works fine as does the grouping for Pending and Completed tasks.  The issue is in the filtering by Location.  Its not working correctly.  I will provide the Record selection code below:

{tasks.assndate} <= {?Date} and {tasks.location} = {?Location} and {tasks.status} = "Pending" or {tasks.status} = "Overdue"
or
{tasks.assndate} = {?Date} and {tasks.location} = {?Location} and {tasks.status} = "Completed"
or
{?Location} = "All" and {tasks.assndate} <= {?Date} and {tasks.status} = "Pending" or {tasks.status} = "Overdue"
or
{tasks.assndate} = {?Date} and {tasks.status} = "Completed"

Any help would be greatly appreciated!

AndyITsupport
0
Comment
Question by:AndyITsupport
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Ken Turner
ID: 10900593
I suggest you try extensive use of brackets in your selection formula to make sure all the OR's and AND's are evaluated in the correct order.
0
 
LVL 2

Author Comment

by:AndyITsupport
ID: 10901013
Is there anyway to force evaluation in a specific order?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 350 total points
ID: 10902605
Yes.  Use (  )

If my memory is correct AND is evaluated before OR.  So in your case

{tasks.assndate} <= {?Date} and {tasks.location} = {?Location} and {tasks.status} = "Pending" or {tasks.status} = "Overdue"
                                             1                                                2                                           8
or
9
{tasks.assndate} = {?Date} and {tasks.location} = {?Location} and {tasks.status} = "Completed"
                                           3                                                 4
or
10
{?Location} = "All" and {tasks.assndate} <= {?Date} and {tasks.status} = "Pending" or {tasks.status} = "Overdue"
                              5                                              6                                          11
or
12
{tasks.assndate} = {?Date} and {tasks.status} = "Completed"
                                           7


I think this is more what you want
(({tasks.assndate} <= {?Date} and {tasks.location} = {?Location}) and ({tasks.status} = "Pending" or {tasks.status} = "Overdue"))
or
({tasks.assndate} = {?Date} and {tasks.location} = {?Location} and {tasks.status} = "Completed")
or
(({?Location} = "All" and {tasks.assndate} <= {?Date}) and ({tasks.status} = "Pending" or {tasks.status} = "Overdue"))
or
({tasks.assndate} = {?Date} and {tasks.status} = "Completed")

mlmcc
0
 
LVL 2

Author Comment

by:AndyITsupport
ID: 10903137
Thanks for the help mlmcc!

I got it working.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 10905118
Glad I could help

mlmcc
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

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. …
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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