Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    21

    Unanswered: select where criteria is met and exclude certain entries

    hi,

    whats wrong with this? :

    Code:
    SELECT `invoice`.`franchise_no`, 
           `invoice`.`invoice_date`, 
           `invoice`.`invoice_date_due`, 
           `invoice`.`invoice_net`, 
           `invoice`.`invoice_no`, 
           `invoice`.`order_no`
    FROM `invoice` `invoice`
    WHERE ( `invoice`.`invoice_net` < 130 )
    AND invoice_net NOT IN (
    SELECT `invoice`.`franchise_no`, 
           `invoice`.`invoice_date`, 
           `invoice`.`invoice_date_due`, 
           `invoice`.`invoice_net`, 
           `invoice`.`invoice_no`, 
           `invoice`.`order_no`
    FROM `invoice` `invoice`
    WHERE invoice_net = 70  )
     );
    i need the records less than 130 but exclude any that are exactly 70!!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Code:
    SELECT `invoice`.`franchise_no`, 
           `invoice`.`invoice_date`, 
           `invoice`.`invoice_date_due`, 
           `invoice`.`invoice_net`, 
           `invoice`.`invoice_no`, 
           `invoice`.`order_no`
    FROM `invoice` `invoice`
    WHERE ( `invoice`.`invoice_net` < 130  AND `invoice`.`invoice_net` != 70)
    you may need to tinker with the not equals sign it could be <> 70
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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