Results 1 to 10 of 10
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Checking for NULL in SQL Server (SQL Server 2000, ASP Classic)

    I am finishing up the first part of a search engine that outputs a table to a webpage. The table uses a border setting of 1 to make it easier to grok, but this means that when there is no content in a given cell it looks 'funky'. Generally speaking, SQL Server lists <NULL> in these cells. I am trying to but something, say

  2. #2
    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

    Re: Checking for NULL in SQL Server (SQL Server 20

    Steve

    Just to let me understand what does "grok" and "funky" mean in the context of this message
    Jerry

  3. #3
    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

    Re: Checking for NULL in SQL Server (SQL Server 20

    Have you tried

    Response.Write "</td><td>"
    if myRS.Fields("FirstName") IS NULL then
    Response.Write(" ")
    else
    Response.write myRS.Fields("FirstName")
    end if
    Jerry

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for NULL in SQL Server (SQL Server 20

    grok means 'to understand' and funky means 'it looks wack'

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for NULL in SQL Server (SQL Server 20

    is did and it says that the object does not support this property. these are by and large nvarchar fields, so, text.

  6. #6
    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

    Re: Checking for NULL in SQL Server (SQL Server 20

    Whoops sorry, I didn't vector that in. Thanks for the low down on the words, I know grok was used in PERL but just checking <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Jerry

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

    Re: Checking for NULL in SQL Server (SQL Server 20

    <img src=/S/pirate.gif border=0 alt=pirate width=22 height=18> "To grok" is from the science fiction novel "Stranger in a Strange Land" by Robert Heinlein. Its main character Michael Valentine Smith is a human who has been raised by Martians, and he uses terms such as "grok".

  8. #8
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for NULL in SQL Server (SQL Server 20

    grok is used in PERL? geez, what hippies! <img src=/S/bagman.gif border=0 alt=bagman width=27 height=27>

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

    Re: Checking for NULL in SQL Server (SQL Server 2000, ASP Classic)

    Try

    If IsNull(myRS.Fields("FirstName")) Then

  10. #10
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Checking for NULL in SQL Server (SQL Server 2000, ASP Classic)

    gracias, that worketh.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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