locked
Result does not exist RRS feed

  • Question

  • User475570419 posted

    I am trying to do a report field in Crystal where if the file does not exist based on a certain field, it will return a blank value, if it does exist, it return the date.

    Here is my code:

    If isnull({CHARGE_SENTENCE.SENT_END_DATE}) then "Awaiting Trial" Else if then {CHARGE_SENTENCE.SENT_END_DATE}

    I have tried several itterations but not luck.

    Thank you

     

    Friday, July 19, 2013 9:44 AM

Answers

  • User-578610739 posted

    Hi Nighthawk0712,

    Your code is seems perfect ,but while you set a value , you must return in same datatype. If you remember in sqlserver union function like that.

    So in your case code is like

    StringVar text ;
    If isnull({CHARGE_SENTENCE.SENT_END_DATE}) then 
       text := "Awaiting Trial" ;
    Else 
       text :=  Totext ({CHARGE_SENTENCE.SENT_END_DATE});   //here proper casting required as you have date, so convert into string by ToText, cstr function
    
    return text;  



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 20, 2013 5:05 AM

All replies

  • User-578610739 posted

    Hi Nighthawk0712,

    Your code is seems perfect ,but while you set a value , you must return in same datatype. If you remember in sqlserver union function like that.

    So in your case code is like

    StringVar text ;
    If isnull({CHARGE_SENTENCE.SENT_END_DATE}) then 
       text := "Awaiting Trial" ;
    Else 
       text :=  Totext ({CHARGE_SENTENCE.SENT_END_DATE});   //here proper casting required as you have date, so convert into string by ToText, cstr function
    
    return text;  



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 20, 2013 5:05 AM
  • User475570419 posted

    Thnak you for your help and reply. It was much appreciated.

    Monday, July 29, 2013 8:50 AM