Solved

Grouping/Parameter Field issues - Crystal Reports 9

Posted on 2004-04-23
5
321 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
[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
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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. …
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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