CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2009

    Need help with formula

    Hi, I need Some help. i have report which generate invoice, there is two amount field one in $ and other is PK , In $ field always some value but some time pk field is null,


    i need some formula which is check,when PK field is null then convert $ field in word else convert pk field

    hope you are understand my question

    I use blow formula to convrt number into word this formula working perfectly

    currencyvar tt;
    currencyvar dect;
    tt :={ship.comm_amount};
    dect := tt - Truncate(tt);
    tt := truncate(tt);
    dect := dect * 100;
    if dect = 0 then
    UPPERCASE('$ ' + ToWords (tt,0 )) + ' ONLY'
    UPPERCASE('$ ' + ToWords (tt,0) + ' And CENT ' + ToWords(dect,0)) + ' ONLY ';

    Thanks in advance

  2. #2
    Join Date
    Jul 2005

    Re: Need help with formula

    You may use the IsNull function to test the field and construct the If-Then-Else around your existing formula
    Extracted from Crystal Reports help
    IsNull (fld)
    Basic and Crystal syntax.

    fld is any valid database, memo, or BLOB field.
    Boolean Value

    Evaluates the field specified in the current record and returns TRUE if the field contains a null value.

    Typical uses
    You can use this function in a record selection formula to limit the report to records that have something other than a null value in the field specified. You can also use it to have the program take some action whenever it encounters a null value.

    Some databases support null data values and others do not. This function will not work if the active database(s) do not support null values. If the database(s) do support null values, the function can be used to reference the null values that get created as the result of a failed lookup while joining.

    Note: Zero and blank (empty or " ") are not null values.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.