Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    String with No Length (SQL 2K)

    More a comment than a question but this thoroughly irritated me this afternoon.

    I was doing some statistical analysis on some data on my system to see how many people didn't have an email address and used this:

    where usr.vchemailalias is null

    and was pleased to note that having put this line in it appeared everyone had an email address, but as I am a careful fellow I changed the line to this:

    where len(usr.vchemailalias) <1

    and 2030 records miraculously appeared but if you put in

    where len(usr.vchemailalias) =0

    No records appear

    <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

    Mentioned it in passing to the Oracle DBA, who commented "You'd never get that in Oracle" <img src=/S/innocent.gif border=0 alt=innocent width=20 height=20>
    Jerry

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: String with No Length (SQL 2K)

    What happens when you use :

    Nz(len(usr.vchemailalias))=0
    or
    Nz(len(usr.vchemailalias))<1
    Regards,
    Rudi

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

    Re: String with No Length (SQL 2K)

    Jezza is working with SQL Server, not with Access. Nz is specific to Access.

  4. #4
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: String with No Length (SQL 2K)

    Sorry. I did not know that, (until now).
    Regards,
    Rudi

Posting Permissions

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