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

Changing Date for Data Evaluation

Status
Not open for further replies.

NavyFederalDetta

Technical User
Mar 22, 2006
16
Is there a way to have Crystal read data for a previous date.

Example, I am working with a depreciation report. Everything is read as of the data in the db at the time I hit "refresh". Sometimes, however, we may need to go back and review what the depreciation was on a particular date in the past.

I don't know how to write "for" stmts but I wanted to say "For (currentdate = 11/30/2006) do {@YTDdeprecation}". Can someone tell me the correct way to change the evaluation date?

Thank you!!
 
Since we don't know what's in {@YTDdeprecation}, of course we cannot.

In general you accomplish this by creating a parameter of type date and setting a default value to 1/1/1970 or some such, and then going into Report->Selection Formula-Record and place a formula such as:

(
if {?MyDateParm} <> cdate(1970,1,1) then
{table.datefield} <= {?MyDateParm}
else
if {?MyDateParm} = cdate(1970,1,1) then
true
)

-k
 
Thank you!!!

I found a way to do this without writing a formula. I was trying to create a "Parameter" and happened upon the following on the menu bar:

"Report"
"Set Print Date and Time"

sorry if I wasn't clear about my question but this is exactly what I was trying to accomplish.
Using this tool I can set the evaluation date to whatever date I want and it calculates my totals as of that date.

thanks again for your quick response. I have browsed thru some of your other threads and you are incredibly knowledgeable!

Detta
 
That should work too, however you'll need to remember to set it.

If you use a parameter it will always prompt you, and it will allow for scheduling the report.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top