very simple i would think to those who would know what to do but having a hard time:
i've addresses. street names and addresses on the streets. so those are the two fields. i want to arrange the whole thing according to how the route should be done. so i've done queries for subsections like A means north, and the way the North should be done, B query, means south area, and the way the streets should be arranged when if someone were to do area B only. problem: when I do a union query A+B, the result gets rearranged. I want the query union to actually "concatanat e" not rearrange the way the table is displayed. to be honest, i don't even know what field the union is using to actually arrange the table records (VERY IMPORTANT: there are no repeated records)
thanks again for the help
2 1510 jimatqsi 1,273
Recognized Expert Top Contributor
You need to know what the sort order is. Apparently you have not specified a sort order, and you need to do that. The first part of the sort order should be the indicator for the area, so all of north sort together, all of south sort together, etc....
I think you need to make another query that uses the union query as input. This query is the one that will do the sorting.
Jim
Oralloy 988
Recognized Expert Contributor
samul,
You have a slight problem, in that a UNION query returns unique records. It has to sort the results in order to remove duplicates.
On the other hand, you can impose an "ORDER BY" clause at the end of your "UNION"s to give you the desired ordering. For example: - SELECT Count(*) AS [CWR Fail],
-
0 AS [H&S Fail],
-
0 AS [Liability Fail]
-
FROM CompanyData
-
WHERE ([CWR Received]=No)
-
UNION
-
SELECT 0 AS [CWR Fail],
-
COUNT(*) AS [H&S Fail],
-
0 AS [Liability Fail]
-
FROM CompanyData
-
WHERE ([H&S Approved]=No)
-
UNION SELECT 0 AS [CWR Fail],
-
0 AS [H&S Fail],
-
COUNT(*) AS [Liability Fail]
-
FROM CompanyData
-
WHERE ([Liability Approved]=No)
-
ORDER BY [Liability Fail] DESC;
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: PATGMorris |
last post by:
I've got a Union Query that pulls data from two different tables for
chemistry and micro testing. The tables containing very similar data but
for reasons not necessary here, cannot be put into one table (differing
types of results mainly)
However, both have date entry fields for varying time stations from an
initial, 2 weeks, 1 month, 2...
|
by: Sim Zacks |
last post by:
I am using 8.0 beta 1 on an RH 8 Linux server.
I have a union query that I am converting from access (where it
worked) and it is returning duplicates. The only difference between
the two rows is the Row field, which is returned automatically.
and an example of a row that it has returned duplicate. I have
verified that the row only shows...
|
by: tricard |
last post by:
Good evening,
I was thinking about making a very simple DOS based (console) menu for
a project that i am working on, but I have no idea where to start for
something like this. Does anyone have any resources they could point me
to or shed some light on what it is that you do exactly. Like I said, I
don't want a real complicated menu, just a...
|
by: planetthoughtful |
last post by:
Hi All,
I'd like to place a subreport onto a report that draws its records from
a UNION query.
When I design the query and view the records all looks fine. However,
when I put the query as the subreport's data source and open it, Access
complains that Jet can't find the table, and then when I open up the
query itself to look at the SQL,...
|
by: BillCo |
last post by:
I'm having a problem with a union query, two simple queries joined with
a union statement. It's created in code based on parameters. Users were
noticing some inconsistant data and when I analysed the query produced
and opened it from a MS Query it started giving strange results.
The first query when run alone returns 22 records, some of...
| |
by: RJMac |
last post by:
I’m using ADO 2.6 in VB6 to read in data from a Union query (qryJoinBalanceData) in Access 2000. The Union query contains 3 sub-queries, each of which joins several tables, but they all generate exactly the same fields containing the same type of data.
I’m using qryJoinBalanceData as the source for a Group By and Sum query which compresses 4600...
|
by: catudalg |
last post by:
Configuration:
Windows 2000 sp3
MS Access 2000 (9.0.4402 SR-1)
Visual Foxpro 9.0 detached tables
MS VFP Driver 6.01.6830.01 06/19/2003
For example, a simple query like:
select * from ddwg1
union all
select * from ddwg2
|
by: MLH |
last post by:
How can I turn the following into a make-table query?
SELECT & " " & AS Recipient FROM
tblVehicleJobs INNER JOIN tblAddnlOwnrs ON tblVehicleJobs.VehicleJobID
= tblAddnlOwnrs.VehicleJobID WHERE
tblVehicleJobs.VehicleJobID=GetCurrentVehicleJobID();
UNION SELECT AS Recipient FROM tblVehicleJobs INNER
JOIN tblLienHolders ON...
|
by: runway27 |
last post by:
I have a table in mysql which i have defined as date and the values that are inserted have the following format for example : 2007-10-30 08:02:40
My requirement is to run a select query to retrieve a particular column on a specific date ex= "SELECT columnname from tablename where columnname='$dt'";
$sd=mysql_query($selectdate);...
|
by: emandel |
last post by:
Is there any way to allow me to edit information in a union query? In other words can I update information from within this query? For some reason it doesn allow me to change any information in the datasheet view of the query.
SELECT , ,
FROM
WHERE is not null
UNION SELECT , ,
FROM
WHERE is not null
ORDER BY ;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |