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!

Need a Days Elapsed Formula 1

Status
Not open for further replies.

JHear1

Technical User
May 4, 2001
14
0
0
US
I want to create a report that shows all tickets older than 30 days. I assumed that I would subtract the date the ticket was logged from the current date, but have had no luck. This is the formula that i have tried.
Whileprintingrecords;
Datevar Open:=Date({CallLog.RecvdDate});
Datevar Current:=Date(CurrentDate);
NumberVar Days:=(Current-Open);
If(Days)>= 30 Then 1 else 0

This is reporting from the HEAT 5.01 Problem Management Database.
Thanks,
Jeff
 
I am using Crystal 7.
The dates in the CallLog.RecvdDate = 2001-05-11
Print Date = 5/11/2001
Date & Time Last Modified = 989,582,208
Is what I have to work with so far.
Thank You for your reply.
Jeff
 
I was actually referring to the variable Days in your formula - what value to have for Days? Malcolm Wynden
I'm for sale at malcolm@wynden.net
 
Is your receive date a string? In V7, the DATE function won't convert a string to a date.

Also, in V7 you don't need to (and can't) put CurrentDate into the Date Function. It is already a date. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
From your questions, I think that my attempt at a formula is not correct. I don't have a value set for "days" as that is what I'm trying to calculate. The date formats that the system is providing is as stated above. I may need to go to Crystal 8 to get this to work?

 
>>The date formats that the system is providing is as stated above

What I need to know is the datatype, which is defined in the database. Right-click on the field and select "Browse-Data" to check the data type. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thanks for the step by step, I can be dense.
Answers as follows;
CallLog.RecvdDate = 2001-05-11 (STRING)
Print Date = 5/11/2001 (Field Insert - No Browse)
Date & Time Last Modified = 989,582,208 (NUMBER)
Thanks,
Jeff

 
Try the following:

if CurrentDate - DTSToDateTime ({CallLog.RecvdDate})>30
then 1
else 0

the DTS functions are under "Additional". Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Thank You. That worked perfect. You are the man!
 
I have two DateTime fields CREATETIME & TERMINATION what I'm trying to do is to subtract the TERMINATION from the CREATETIME to get my processtime from my queue. My problem is that I don't want the time period from 5:00PM to 8:00AM to be included in my calculation.

Example: Createtime 5/14/01 3:00 PM Temination 5/15/01 10:00 AM Total Process Time 19hrs. I would like this to be 4hrs of processing time.

I am using CR8..

Thanks for any help,

Mike
 
Check the FAQ section of the General CR forum. I have a FAQ on common formulas that has a formula that does what you want. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top