Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Texas
    Posts
    20

    Unanswered: Formula to test for Nulls

    In VBA it would be:

    If IsNull(Date1)=true then
    Days = ""
    Else If IsNull(Date2)=true then
    Days = Date()-Date1
    Else
    Days = Date2 - Date1
    End If

    How would we do that in Crystal 9?

  2. #2
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    23
    //There is one big difference between vba and Crystal:
    //In Crystal are no Variants available.

    Try this one:
    If IsNull(Date1)Then //IsNull returns only true or false, that's enough
    Days = ""
    Else If IsNull(Date2) then
    Cstr(CurrentDate-Date1)
    Else
    Cstr(Date2 - Date1)

    //The result is automaticly set this way

  3. #3
    Join Date
    Sep 2003
    Location
    Texas
    Posts
    20
    Thank you very much.

Posting Permissions

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