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

Date Formula

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
I need a formula to calculate turn-around-time of assignments. If the assignment is completed, the following formula works. However, if there is no completion date, I get a zero when what I want is the number of days between the assignment date and the current date.

if IsNull ({ALL_ASSIGNMENTS.Date Completed}) then (currentdate - {ALL_ASSIGNMENTS.Date Assigned}) else
({ALL_ASSIGNMENTS.Date Completed} - {ALL_ASSIGNMENTS.Date Assigned})
 
If the item is not completed, is the date field truly null, or is it a zero? To test this, write a quick formula:

IsNull ({ALL_ASSIGNMENTS.Date Completed})

Place it on the report and see if it shows up as true or false on items that are not completed.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
I inserted your formula. Comes up "False" Date Completed or no Date completed. No "True"'s.
 
Not too pretty, but this formula works:

if totext({ALL_ASSIGNMENTS.Date Completed}) = "" then (currentdate - {ALL_ASSIGNMENTS.Date Assigned}) else
({ALL_ASSIGNMENTS.Date Completed} - {ALL_ASSIGNMENTS.Date Assigned})
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top