Results 1 to 1 of 1

Thread: [RESOLVED] SQLCE & Query

Threaded View

  1. #1

    Thread Starter
    Fanatic Member Strider's Avatar
    Join Date
    Sep 2004
    Location
    Dublin, Ireland
    Posts
    612

    Resolved [RESOLVED] SQLCE & Query

    I need to compare two tables in my sql ce database.
    Normally to do this i would union the two tables then select the name field and sum the oty field.

    this is my sql statement

    Code:
    SELECT A, SUM(B) FROM tbl_1 WHERE C = " & myVAL & " GROUP BY A 
    UNION 
    SELECT A, SUM(B) FROM tbl_2 WHERE C = " & myVAL & " GROUP BY A
    if i run this sql statement in the query analyser it works fine, yet if i put it inside my applicaion, its does not work and i get an sql exception.

    am i missing something,
    if i remove the WHERE Clause it will union the 2 tables fine inside my application
    Last edited by Strider; Jul 8th, 2005 at 09:23 AM.
    Barry


    Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
    .NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0

    SQL Server 2005/2000/SQL Server CE 2.0


    If you like, rate this post

    Compact Framework for Beginners

Posting Permissions

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



Click Here to Expand Forum to Full Width