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

Make a formula return Null 2

Status
Not open for further replies.
Nov 15, 2000
322
US
Can I make a formula return a Null?

Code:
If NOT IsNull ({Date1}) 
and ({Date1}>= Date2})
and {Date1} <> DateTime (1900, 01, 01,00, 00, 00)
Then
({Date1}-{Date2})
else
<<NULL>> <-- I want to make it return a Null here

The dates are comparing some customer service response times. A Value of 0 indicates a same-day contact, which is good. If Date1 is null in the DB, then the customer has never been contacted and I should not be reporting a 0. I need a Null here.

Can this be done?

Monkeylizard
Sometimes just a few hours of trial and error debugging can save minutes of reading manuals.
 
You could create a formula {@null} by opening a new formula and saving and closing it without entering anything. Then change your formula to:

if isnull({Date1}) then
tonumber({@null}) else
if {Date1} >= Date2} and
{Date1} <> DateTime (1900, 01, 01,00, 00, 00) Then
{Date1} - {Date2}

-LB
 
Perfect.

Have a star!

Monkeylizard
Sometimes just a few hours of trial and error debugging can save minutes of reading manuals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top