Results 1 to 2 of 2

Thread: Can't select null value

  1. #1
    Join Date
    May 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can't select null value

    Hello everybody,
    I'm having this problem, i'm trying to select the users in my db which are not in any of the groups so their group id will be null. But when i write the sql statment it returns nothing althought there are so many users with no group.
    this my sql statment
    Code:
    <select name="attachuser" size="1" >
    	<option value="" >Select User</option>
    	<%
    	sql="select * from users where group_id=null "
    	set rs=conn.Execute(sql)
    	while not rs.eof
    	%>
    <option value="<%=rs("user_id")%>" ><%=rs("user_name")%>
    </option>
    	<%
    	rs.movenext
    	wend
    	%>
    </select>
    I'm using sql server 2000,
    Thank u very much
    Yoya

  2. #2
    Join Date
    Jul 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,
    Hopefully you found your answer in a SQL guide.

    Try
    sql="select * from users where group_id is null "

    Ian

Bookmarks

Posting Permissions

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