Solved

Need assistance to modify a Crystal Report with an existing date field that Is Not Null and a date range for that field

Posted on 2013-01-08
11
434 Views
Last Modified: 2013-01-27
We have a Crystal Report that needs to show a date field (p_termdate) that Is Not Null in a modified report. This report was modified from a full employee listing. However, since the request is to show only those employee’s with a termination date, we will also need to apply a start/end date for HR to enter based on the termination date for the report. I have never modified a Crystal Report and am asking for some assistance to modify this Employee Termination Report List.

This is the field to base the report on:
{HRPERSNL.p_termdate}
0
Comment
Question by:edrz01
[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
  • 6
  • 2
11 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 300 total points
ID: 38757309
You will need to add a parameter either as a range for the date or 2 parameters as start and end date.

You can then use the SELECT EXPERT to filter the data with

{HRPERSNL.p_termdate}  IN {?DateRange}

or

{HRPERSNL.p_termdate}  >= {?StartDate} AND {HRPERSNL.p_termdate}  <= {?EndDate}

mlmcc
0
 

Author Comment

by:edrz01
ID: 38757339
I will check your solution tomorrow and evaluated the output. Thank you mlmcc...
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 200 total points
ID: 38758079
If the field could be null, you should check for that first.  For example:

not IsNull ({HRPERSNL.p_termdate}) and
 {HRPERSNL.p_termdate} in {?StartDate} to {?EndDate}


 James
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

Author Comment

by:edrz01
ID: 38789579
I am using {?StartDate} to {?EndDate}
And I am receiving an Error "This field name is not known" with {?StartDate} to {?EndDate}
0
 

Author Comment

by:edrz01
ID: 38789605
Seems the Crystal Reports does not like:
{?StartDate}
{?EndDate}
{?DateRange}

I am receiving an Error "This field name is not known"
0
 

Author Comment

by:edrz01
ID: 38789681
Disregard for now: I did not add the Parameter ?StartDate, ?EndDate or ?DateRange... will try again in the morning.
0
 

Author Comment

by:edrz01
ID: 38803202
James I did use your recommendation  {HRPERSNL.p_termdate} in {?StartDate} to {?EndDate}

However, as a very new user to Crystal Reports, I was unfamiliar with the initial set to create new Parameters StartDate and EndDate. Eventually, I was able to figure what was missing... which leads to the length of time to respond adequately.

The next missing step was 'where' to place the statement above, which I now understand it should be in the Record Selection Formula Editor.

Now the Report asks for the Date Range to Preview. One additional piece I added:
{hrpersnl.p_active} = "T" and {HRPERSNL.p_termdate} in {?StartDate} to {?EndDate}
Where p_active checks to see if the employee is Active or Terminated 'T'.

Thank you for your advice and recommendation.
0
 
LVL 35

Expert Comment

by:James0628
ID: 38804530
mlmcc should probably get most of the points.  He said that you needed to add a parameter, and to use the Select Expert (Report > "Select Expert") to add the test.  I just added the part about testing for nulls (and it seems like you're not actually using that).

 You can use the "Request Attention" link under your first post to ask to have the question re-opened, and then split the points between us if you like.

 James
0
 

Author Comment

by:edrz01
ID: 38808040
Approved
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 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