adding queries together but not imposing their criteria on each ot

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create a simple-looking billing report. Customers need to be
organized by protocol; High-speed first (FTP, VPN, HTTPS) and then dial-up
(ASYNC, BISYNC, SNA). But each group also needs to be in order by ID. I have
two queries right now. One does high-speed and the other does dial-up. Now, I
just want to combine the results (see example below) for a report in Excel.
Is combining queries the way to go?
This query:
ID Protocol code fee
ACW137 FTP 3 50
ACW143 VPN 3 50
ADW125 VPN 3 50
ADW127 HTTPS 3 50
ADW128 FTP 3 50

combined with this one:

ID Protocol code fee
AACTRE ASYNC 1 30
ABOLULIN BISYNC 1 30
BARTPL ASYNC 1 30
CLORSP ASYNC 1 30
COPTWQ SNA 1 30

to produce:

ID Protocol code fee
ACW137 FTP 3 50
ACW143 VPN 3 50
ADW125 VPN 3 50
ADW127 HTTPS 3 50
ADW128 FTP 3 50
AACTRE ASYNC 1 30
ABOLULIN BISYNC 1 30
BARTPL ASYNC 1 30
CLORSP ASYNC 1 30
COPTWQ BISYNC 1 30
 
You should be able to use a union query. You might need to add a derived
column/field for the speed value.
 
You could either union the two query results together, if the data
comes from different tables, or you could use an OR in your criteria...


The sorting issue... If you had a table to link the protocol to a
number that's sorted in the order you want, then you could do the sort
on the number (ProtocolText, ProtocolSortOrder (a number)), then you
could sort on ProtocolSortOrder but show the ProtocolText in your
report or query.
 
Back
Top