cancel
Showing results for 
Search instead for 
Did you mean: 

Aged from current date

former_member290153
Participant
0 Kudos

Hi All,

I had a trouble writing formula in Crystal Report.

Here is my issue. Please check.

I need to write formula for Aged Days and this should be ( Currentdate - My date field)

So I written: CURRENTDATE - cdate(my date field) It is working fine.

But, my date field is having few blank values means Nulls at that place it showing "#".

So at that time it is throwing error : "BAD DATE FORMAT" So I should eliminate "#" whenever it comes and replace it with "0"

so that it wont throw error. i tried bot these formulas still error.

IF ISNULL({Constituent.LastName}) THEN {Constituent.OrgName} ELSE {Constituent.LastName} IF NOT ISNULL({Constituent.LastName}) THEN {Constituent.LastName} ELSE {Constituent.OrgName}

Please check if possible let me know the solution. That should be sinple IF statement where we need to put "0" whenever it get "#". That it

Thanks in Advance.

Priyanka.

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Priyanka,

Try:

CurrentDate - (If {Date Field} = '#' then cdate(0,0,0) else cdate({Date Field}))

-Abhilash

Answers (1)

Answers (1)

former_member290153
Participant
0 Kudos

Hi Abhilash,

Thanks for quick response and help.It's working fine.

Regards,

Priyanka.