?
Solved

Select Expert Sorting

Posted on 2012-04-11
3
Medium Priority
?
327 Views
Last Modified: 2012-04-11
I have a formula that get's 're-prioritized' after the report refreshes and doens't display what I'm expecting.  

My Record Selection Formula looks like this:

{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam} and

If {?EmployeeName} = 'ALL' then
{empMain.firstname} like '*'
else {empMain.firstname} = {?EmployeeName}


And I don't get any errors.  However, when I refrsh the report, it displays more results that I anticipated.  Then when I go in and look at the formula it has changed to this:

If {?EmployeeName} = 'ALL' then
{empMain.firstname} like '*'
else {empMain.firstname} = {?EmployeeName} and
{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam}

How do I prevent this from happening?
Labor-Report---with-Parameters-N.rpt
0
Comment
Question by:ITworks
[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
3 Comments
 
LVL 9

Assisted Solution

by:BlueYonder
BlueYonder earned 668 total points
ID: 37833417
The formula should be as below.  The like '*' is not required.

If {?EmployeeName} = 'ALL' then
{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam}
else
{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam} and
{empMain.firstname} = {?EmployeeName}
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1332 total points
ID: 37833458
Your version just needs ( )

{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam} and
(
If {?EmployeeName} = 'ALL' then
{empMain.firstname} like '*'
else {empMain.firstname} = {?EmployeeName}
)

mlmcc
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1332 total points
ID: 37833464
Another way to do this is

{aptp_view_time_cards.JobNumber} = {?JobNumber} and
{@EndDateOnly} = {?DateParam} and
{@StartDateOnly} = {?DateParam} and
(
    {?EmployeeName} = 'ALL'  OR  {empMain.firstname} = {?EmployeeName}
)

mlmcc
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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

764 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