• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Grouping/Parameter Field issues - Crystal Reports 9

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
AndyITsupport
Asked:
AndyITsupport
  • 2
  • 2
1 Solution
 
Ken TurnerCommented:
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
 
AndyITsupportAuthor Commented:
Is there anyway to force evaluation in a specific order?
0
 
mlmccCommented:
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
 
AndyITsupportAuthor Commented:
Thanks for the help mlmcc!

I got it working.
0
 
mlmccCommented:
Glad I could help

mlmcc
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now