+ Reply to Thread
Results 1 to 4 of 4

Excel MS Query multiple select statements

  1. #1
    Revenger
    Guest

    Excel MS Query multiple select statements

    Hi all,
    I have a problem with MS Query in Excel.
    I have multiple select statements which MS Query can't interpret.
    I'm doing a query to Informix database, and if I have only one select
    statement, everything works ok, but if I try to retreive the data from 2 or
    3 databases I have to use several select statements, and MS Query can't do
    that.
    I'm getting an error "Didn't expect ";" after the column list in the ORDER
    BY clause"
    SQL statement on the database server works fine.

    Can anyone help me with this ?

    Thanks !
    --
    Pozdrav
    Revenger
    11.5.2006 15:14:23
    Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
    itko sere po njemu.

  2. #2
    Ardus Petus
    Guest

    Re: Excel MS Query multiple select statements

    If all queries return the same number of columns, join then with UNION ALL

    SELECT a,b,c from d
    UNION ALL
    SELECT a,b,c from e
    UNION ALL
    SELECT a,b,c from f

    HTH
    --
    AP

    "Revenger" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Hi all,
    > I have a problem with MS Query in Excel.
    > I have multiple select statements which MS Query can't interpret.
    > I'm doing a query to Informix database, and if I have only one select
    > statement, everything works ok, but if I try to retreive the data from 2
    > or
    > 3 databases I have to use several select statements, and MS Query can't do
    > that.
    > I'm getting an error "Didn't expect ";" after the column list in the ORDER
    > BY clause"
    > SQL statement on the database server works fine.
    >
    > Can anyone help me with this ?
    >
    > Thanks !
    > --
    > Pozdrav
    > Revenger
    > 11.5.2006 15:14:23
    > Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
    > itko sere po njemu.




  3. #3
    Revenger
    Guest

    Re: Excel MS Query multiple select statements

    On Thu, 11 May 2006 15:54:42 +0200, Ardus Petus wrote:

    > If all queries return the same number of columns, join then with UNION ALL
    >
    > SELECT a,b,c from d
    > UNION ALL
    > SELECT a,b,c from e
    > UNION ALL
    > SELECT a,b,c from f


    Thanks ! This helps alot !


    --
    Pozdrav
    Revenger
    12.5.2006 12:23:18
    Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
    itko sere po njemu.

  4. #4
    Ardus Petus
    Guest

    Re: Excel MS Query multiple select statements

    Your last post was quite empy!!!

    --
    AP

    "Revenger" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > On Thu, 11 May 2006 15:54:42 +0200, Ardus Petus wrote:
    >
    >> If all queries return the same number of columns, join then with UNION
    >> ALL
    >>
    >> SELECT a,b,c from d
    >> UNION ALL
    >> SELECT a,b,c from e
    >> UNION ALL
    >> SELECT a,b,c from f

    >
    > Thanks ! This helps alot !
    >
    >
    > --
    > Pozdrav
    > Revenger
    > 12.5.2006 12:23:18
    > Jednom su proizveli Chuck Norris toalet papir, ali papir nije dopustao da
    > itko sere po njemu.




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1