Results 1 to 5 of 5

Thread: [RESOLVED]check for date null value doesn't work. help.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    [RESOLVED]check for date null value doesn't work. help.

    hi,
    I have formula that checks for two date fields and displays the earlier one.
    I tried these tow formulas:

    if date1 < date2 OR date1 = date2 then date1
    else if isnull(date1) then date2
    else if isnull(date2) then date1
    ----------------------------------------------
    if date1 < date2 then date1
    Else date2
    ----------------------------------------------
    these formulas work if none of the dates is Null.
    the data is coming from Stored Proc and when I run it in the analyser I get Null values for some fields.

    any suggestions?
    thanks
    Last edited by waely; Nov 7th, 2006 at 08:28 AM.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: check for date null value doesn't work. help.


    If you are saving the null value in the database, or if there is null value in the databse then do one more thing in the formula check that if any date in null then then return second date.
    Because we are not able to compare the date with the null value, so logic say if one date is null the return second date if necessary, other wise you can reture zero also.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: check for date null value doesn't work. help.

    thanks.
    what is the syntax for checking empty date value?

    waely

    Quote Originally Posted by shakti5385

    If you are saving the null value in the database, or if there is null value in the databse then do one more thing in the formula check that if any date in null then then return second date.
    Because we are not able to compare the date with the null value, so logic say if one date is null the return second date if necessary, other wise you can reture zero also.

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: check for date null value doesn't work. help.

    VB Code:
    1. If isnull(date1) then date2
    2. else if isnull(date2) then date1
    3. else if date1 < date2 OR date1 = date2 then date1

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Posts
    150

    Re: check for date null value doesn't work. help.

    Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width