Results 1 to 5 of 5

Thread: IsNull (XP/2K)

  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    IsNull (XP/2K)

    IS there a better way to write this using NZ
    Thanks

    If IsNull(Me.dtBirthF) = False Then
    !dtBirth = CDate("01/" & "01/" & Me.dtBirthF)
    End If

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IsNull (XP/2K)

    Zave,

    Try this.
    !dtBirth = CDate("01/" & "01/" & Nz(Me.dtBirthF, 0))

    Your result in !dtBirth will be 01/01/2000 if it is null.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Jerusalem, Israel
    Posts
    708
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: IsNull (XP/2K)

    Interesting approach, but it would throw the other data off, with a false date. I am going for an empty field, when there is no data

  4. #4
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IsNull (XP/2K)

    Zave,

    The NZ function changes the value of the tested field to zero if it encounters a null.

    Sorry, I can't think of a way to make the NZ work for you.
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IsNull (XP/2K)

    The purpose of Nz is to replace Null by something that is noy Null, but you *want* Null, so - like Don - I conclude that there is no role for Nz here.

Posting Permissions

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