Results 1 to 4 of 4

Thread: [RESOLVED] Union in Access / SQL2005

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    37

    Resolved [RESOLVED] Union in Access / SQL2005

    In Access 2000 this query works

    Select STDEV(x) from (Select W1 as x from TAB Union All Select W2 from TAB)

    In MS SQL 2005, I get an error: Incorrect syntax near ')'

    ADO, ODBC connection, SQL Server driver.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Union in Access / SQL2005

    I'm not surprised.... STDEV() is probably an Access function... not part of the standard SQL functions... no... wait... alias your table...
    Code:
    Select STDEV(x) from (Select W1 as x from TAB Union All Select W2 from TAB) myData
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2006
    Posts
    37

    Re: Union in Access / SQL2005

    Thanks techgnome.
    In Access and in SQL this query work fine.

    Code:
    Select STDEV(x) from (Select W1 as x from TAB Union All Select W2 from TAB) TAB

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Union in Access / SQL2005

    Great! So if the problem is resolved, can you mark the thread resolved? You can do that by selecting the Thread Tools menu under the first post.

    Thanks!
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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