Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Union Qury

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Simon - 17 May 2007 09:09 GMT
I have the following Union Query but it does not work, If i remove one
of the qrys it works fine,

How do i do a union query for 3 or more bits of data

Thannks

SELECT qryHotTubsWS.[IDNumber] AS IDNumber,
       qryHotTubsWS.[ProductName] AS ProductName,
       qryHotTubsWS.[Price] AS Price,
       qryHotTubsWS.[ProductCode] As ProductCode,
       'qryHotTubsWS' AS TheType
   FROM qryHotTubsWS

UNION ALL SELECT qryExtrasWS.[IDNumber] AS IDNumber,
       qryExtrasWS.[ProductName] AS ProductName,
       qryExtrasWS.[Price] AS Price,
       qryExtrasWS.[ProductCode] AS ProductCode,
       'qryExtrasWS' AS TheType
   FROM qryExtrasWS

UNION ALL SELECT qryProductsWS.[IDNumber] AS IDNumber,
       qryProductsWS.[ProductName] AS ProductName,
       qryProductsWS.[Price] AS Price,
       qryProductsWS.[ProductCode] AS ProductCode,
       'qryProductWS' AS TheType
   FROM qryProductsWS

ORDER BY IDNumber;
KARL DEWEY - 17 May 2007 15:56 GMT
Try removing the    ORDER BY IDNumber       in your SQL.
Signature

KARL DEWEY
Build a little - Test a little

> I have the following Union Query but it does not work, If i remove one
> of the qrys it works fine,
[quoted text clipped - 25 lines]
>
> ORDER BY IDNumber;
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.