Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record Selection Formula Question

Status
Not open for further replies.

tojo1234

Technical User
Mar 29, 2001
1
0
0
US
I have created a report that uses a date range parameter I'll call it ?fromdate and ?todate. I want to create a report that will return the most recent input to a field I'll call "Status" which uses a timestamp field which I will call "Creation_Date". I would like to report on the last time this "Creation_Date" was updated within the date range request. I want the report to print only the records with a "Creation_Date" that was added more than seven days ago. I have been able to create and run a report that includes all "Creation_dates" that are not within the last seven days, but unfortunatly this also returns status that are within the requested date range and only the "creation_Dates that are not in last seven days.
{@DateRange} and
(if {?Group_ID} <> &quot;&quot; then
{@TSGRP} = UpperCase({?Group_ID})
else
{@TSGRP} >= UpperCase({?Group_ID})) and
(if {?Call_Status} <> &quot;&quot; then
{@status} = UpperCase({?Call_Status})
else
{@status} >= UpperCase({?Call_Status})) and
(if {?Operator_ID} <> &quot;&quot; then
{@TSOPER} = UpperCase({?Operator_ID})
else
{@TSOPER} >= UpperCase({?Operator_ID})) and
not ({@CreDate} in Last7Days)



I hope that I was able to explain this correctly, If not I sure someone will lte me know.
Thanks
Kenny
 
Selecting the records and finding the most recent are two different functions. You can't find the most recent until you return all of the eligible records to the report.

So, to be eligible you need a create between start and end, but not in the past 7 days. Is that the right criteria? Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Tojo1234 to it!

You seem to be suffering from the same Crystal Disease that I do most of the time. I may be wrong but it seems you are over complicating this situation.

Lets start with you date Parameters, ?StartDate ?EndDate
and don't forget your {Creation.Date} field. These are the important players if I understood what you wrote.

Try this:

{Creation.Date}>= ?StartDate and
{Creation.Date} < ?EndDate and
{Creation.Date} < currentdate-7

This will eliminate the records you don't want to see

Then Create a group on your Date field {Creation.Date} set the section to be printed for each year, Insert the {Creation.Date} into the details section and then insert a summary on the {Creation.Date} and use 'maximum' in the summary choices. Then suppress the details and Create another Fromula to pull out the staus feild you are looking for:

if {Creation.Date} = Maximum ({TICKET.RUNDATE}, {TICKET.RUNDATE}, &quot;annually&quot;) then {@Status} else ''

I hope this helps

Paul Ellsworth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top