Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    32

    Unanswered: Problem with Simple Query

    Hi

    I'm executing the following query on table OMS_SITEVISIT_ITEMLIST, and it just ain't working. I have tested this in Enterprise Manager.

    SELECT *
    FROM OMS_SITEVISIT_ITEMLIST
    WHERE (eFolderID = 'LAPTOP$LAPTOP$00000956')
    AND (InStock <> - 1)

    I have 3 rows where eFolderID = 'LAPTOP$LAPTOP$00000956' and InStock is NULL. So in theory it should pull back 3 rows, but it doesn't pull any. It does pull back 3 rows if i remove the reference to InStock (which is of type SMALLINT, length 2), so it's the second part of the WHERE clause that's causing the problem.

    Can anyone see where I might be going wrong?

    Cheers
    Greg

  2. #2
    Join Date
    Sep 2003
    Location
    United States
    Posts
    65
    Provided Answers: 1

    use isNull correctly

    Try this lets see...

    SELECT *
    FROM OMS_SITEVISIT_ITEMLIST
    WHERE (eFolderID = 'LAPTOP$LAPTOP$00000956')
    AND isNull(InStock, Null) = Null
    >>
    >> Learn PHP/MySQL for free https://www.youtube.com/watch?v=mpQts3ezPVg
    >> Free Web Hosting with PHP, MySQL, Website Builder : http://www.000webhost.com/862861.html

  3. #3
    Join Date
    Feb 2004
    Posts
    32
    I've come up with a workaround, and done away with the check on -1, but on 0 or NULL.

    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
  •