title: SQL Query Stuck in Infintite Loop
body: <p>I'm running a pretty simple SQL query on my database, and it seems to be returning the same record over and over, creating an infinite loop. Maybe I'm missing something obvious, but I don't see it. Here's the query:</p>
  
  <pre><code>select s.customer as 'Customer',
      s.store as 'Store',
      s.item as 'Item',
      d.dlvry_dt as 'Delivery',
      i.item_description as 'Description',
      mj.major_class_description as 'Major Description',
      s.last_physical_inventory_dt as 'Last Physical Date',
      s.qty_physical as 'Physical Qty',
      s.avg_unit_cost as 'Unit Cost',
      [qty_physical] * [avg_unit_cost] as Value
  from database.DELIVERY d,
      database.STORE_INVENTORY s,
      database.ITEM_MASTER i,
      database.MINOR_ITEM_CLASS mi,
      database.MAJOR_ITEM_CLASS mj,
      database.STORE_INVENTORY_ADJUSTMENT sa
  where sa.store = s.store
      and s.last_physical_inventory_dt between '6/29/2011' and '7/2/2011'
      and s.customer = '20001'
      and s.last_physical_inventory_dt is not null
  </code></pre>
  
  <p>There is one record that falls on 7/1/2011 and it repeats it forever until I cancel the query. </p>
  
  <p>Any help on preventing this?</p>