in

System.Data.SQLite

An open source ADO.NET provider for the SQLite database engine

Query in .NET does not return correct results.

Last post 04-30-2009 8:17 AM by Robert Simpson. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-30-2009 7:02 AM

    Query in .NET does not return correct results.

    Hello, I have a query that if I run in SQL Maestro for SQL Lite returns a result of 8976 records.  This is the same count as if I query SQL Server or MySQL with the same data.  When I run this query though in .NET against the same SQL Lite database I get a result returned of 76 records.  It's only bringing back one of the items in my IN clause.  I've included the query, it uses a between and an IN.  Additionally, I wrapped this query without the where clause in a view, then applied the where clause originally and the same thing occurs, I get 8976 in Maestro, but only 76 records in .NET.  Please advise.

     

    SELECT FACT_POS.CALENDAR_DT AS CALENDAR,
           'My Retailer' AS RETAILER,
           DIM_ITEM.UPC AS ITEMNUMBER,
           DIM_ITEM.PRIMEITEMDESC AS ITEMDESCRIPTION,
           DIM_STORE.STORENUMBER AS STORENUMBER,
           0 AS INVENTORY,
           FACT_POS.SLS_SOLD_DOLLARS AS DOLLARS,
           FACT_POS.SLS_SOLD_QTY AS QUANTITY
    FROM   FACT_POS, DIM_ITEM, DIM_STORE
    WHERE FACT_POS.Calendar_Dt BETWEEN '2008-08-01' AND '2008-10-15'
          AND FACT_POS.Item_Id IN ('71803710450','71803711260','71803711526','71803711725','71803711769','71803711770','71803711771','71803711772','71803711867','71803711872','71803711873','71803711905','71803711943')       AND DIM_ITEM.ITEM_ID = FACT_POS.ITEM_ID
          AND DIM_STORE.STORE_ID = FACT_POS.STORE_ID

  • 04-30-2009 7:27 AM In reply to

    • rkulp
    • Top 10 Contributor
    • Joined on 06-28-2008
    • Rural Coffee County, Tennessee
    • Posts 73

    Re: Query in .NET does not return correct results.

    I've had the same problem. Please look at http://sqlite.phxsoftware.com/forums/p/1473/6393.aspx#6393 for a possible solution.

  • 04-30-2009 7:40 AM In reply to

    Re: Query in .NET does not return correct results.

    Without having the database or the code, I couldn't venture a guess beyond the datetime issue rkulp postulates.

     

  • 04-30-2009 7:56 AM In reply to

    Re: Query in .NET does not return correct results.

    Would you mind if I sent it to you?  Like I said, it's bizare, only happens through the driver.  I also just upgraded the driver from 1.0.51 to 1.0.61 and same issue occurs.

  • 04-30-2009 8:17 AM In reply to

    Re: Query in .NET does not return correct results.

    Sure e-mail the db to me at:  robert at blackcastlesoft dot com

     

Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems