Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Unanswered: Listing orders without a date

    I'm suppose to List all orders where there is no shippedDate (just give their orderNumbers).

    I have this:
    select orderNumber from orders where shippedDate= null;

    I'm not sure what to put in place of the "= null" as that is clearly wrong
    (Note: If I use "select orderNumber from orders where shippedDate;" it prints out all the orders, but I only want the orders where there are no ShippedDate

    Thanx!

  2. #2
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    nothing equals null. it is the absence of value.

    select orderNumber from orders where shippedDate is null;
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    select orderNumber from orders where shippedDate IS NULL;

    What's the Data Type of shippedDate?

    If it's varchar, you might wamt to add

    or shippedDate IN ('', ' ')

    If it's int, you might want to add

    or shippedDate = 0

    But, of course you have typed and sized all of your columns appropriately, so, then just use line 1
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Apr 2012
    Posts
    2
    Thank you very much, the "is" worked perfectly

Posting Permissions

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