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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Aging: Current Date & Previous Dates

Status
Not open for further replies.

cgordonn

MIS
Nov 21, 2001
9
US
I am once again reaching out to the forum users here. I have a report where I need to do some aging calculations. The aging will be based on {currentdate} minus one of my database fields {saildate}. The report has 3 parameters to enter prior to running, these are...

{?CompanyNo)
{?PrincipalNo}
{?AsAtDate}default is {currentdate}

The {?AsAtDate} would normally be the current date. However the user may from time to time need to enter a previous date. How do I design the parameter to by default be the current date, yet allow the user to enter a previous date as needed?

Thanks gang!
CGordonn
 
It should default to the currentdate by not placing anything in the set defaults.

To use he parameter:

Report->Edit Selection Formula->Record:

(
{table.datefield} <= {?AsAtDate}
)

This is dependent upon the version of Crystal you have, at bare minimum you should always post at least that much technical information.

-k
 
Thanks synapsevampire for the feedback. I write all my reports in CR 8.5 Pro. Let me once again clarify what I am attempting to accomplish. Most of the other aging reports that I have worked on did the aging based on CURRENTDATE. In this new report I am working on, I need to age based on a past date...way in the past. Our accounting dept. has recently archived some old AS400 accounting data, and I guess they still need to generate statements, etc based on an PAST DATE. Not to say that they wont ever use the CURRENTDATE.

These reports are for a shipping company, so for this report I am aging against the DATE (past or current) that the user enters in the report parameter and a vessel SAIL DATE that is stored in the database. The differance between thse two dates is the age. Looking at some of the data I am working with, these sail dates range from 04/02 up to 06/03. If I age on CURRENTDATE, then everything shows as being over 90 days old, which is true. However the users want to be able to go back and generate a statement for an older date, which would then show the correct aging for that older date - sail date differance. Correctly achieving this is where I am stuck at, and would appreciate some assistance from the forum.

Thanks again!
CGordonn

 
I guess I understand it now.

To group by the age against the parameter you might use a formula containing:

if {?dateparm}-{table.saildate} < 31 then
&quot;1) 1 - 30 days&quot;
else if {?dateparm}-{table.saildate} < 61 then
&quot;2) 31 - 60 days&quot;
else if {?dateparm}-{table.saildate} < 91 then
&quot;3) 61 - 90 days&quot;
else if {?dateparm}-{table.saildate} > 90 then
&quot;4) over 90 days&quot;

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top