cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a problem with this formula?

Former Member
0 Kudos

I want to test for a blank date field, but isnull(date field) is not evaluating as a null when the field is, in fact, empty. I have Convert Database Null Values to Default checked because I need it checked for other purposes in my report.

As an alternative, I'm using the following formula. Is this equivalent to isnull(date field)?

If length(cstr(date field)) = 0 then "null"

Else (date field)

Is there any scenario under which this this formula would not work?

I'd appreciate any feedback.

Gary

View Entire Topic
Former Member
0 Kudos

Hi,

If LENGTH(TRIM(DATEFIELD)) = 0 OR ISNULL(DATEFIELD) THEN "NULL"

ELSE

TOTEXT(DATEFIELD,"FORMAT");

Regards,

Sathish

Former Member
0 Kudos

Sathish --

I like yours the best (sorry everybody else!).

I like checking for either the length = 0 or ISNULL, just to cover both possibilities.

I was curious why you included "trim" in the formula. What does that do?

Thanks.

Gary