473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I create one report from 2 sorted queries?

I have an Access database containing 2 tables. Tbl1 consist of ref#s and topics. Tbl2 consist of ref#s, topics, comments and dates. From this I created 2 queries. Query #1 has records from the table (topics/dates) sorted by date. Query #2 has the rest of the records (topics/comments) sorted alphabetically. I’m an SQL novice and can’t get my report to combine both queries, with the appropriate sorting. Each query looks how I want it, but when I combine them into one master query, it gets unsorted. I need one report sorted by topics where certain topics are sorted alphabetically and other topics by date.
Feb 14 '10 #1
5 1711
nico5038
3,080 Expert 2GB
Sorting in reports is done using the grouping button.
In your case all needed is the second query with all the information.
In the grouping you place the fields ref#s and topics and for the topics you add a header by setting the option to "Yes"
In the additional section of the report you place the ref#s and topics fields and in the detail section the other fields.

That's all, Access will take care of the sorting.

Nic;o)
Feb 14 '10 #2
My report is more complicated than that. Here's how far I got. Using 2 append queries, I finally have an appended table consisting of topics and comments. All the topics with chronological comments are sorted and listed before the remainder of the topics with alphabetical comments like this:

Table:
topics Comments (chronologically)
topics Comments (alphabetically)

When I create the report based on this table, I grouped the topics sorting ascending and create a header for the topics. The report does list the topics alphabetically, but now all of the comments are unsorted.

Report:
topics Comments (unsorted)
topics Comments (unsorted)
topics Comments (unsorted)
topics Comments (unsorted)
topics Comments (unsorted)
topics Comments (unsorted)

How do I create a report with topics sorted alphabetically, where the comments are sorted alphabetically for certain topics and chronological for the other topics.
What I want is the following:

Report:
topics Comments (chronologically)
topics Comments (alphabetically)
topics Comments (chronologically)
topics Comments (alphabetically)
topics Comments (chronologically)
topics Comments (alphabetically)
Feb 15 '10 #3
nico5038
3,080 Expert 2GB
Can you create a small sample .mdb with the report and a (partially) filled table, then zip it and attach that to your comment so I can have a look ?

Nic;o)
Feb 15 '10 #4
You were right! I now see how powerful a simple thing like grouping/sorting can be. I sorted the report first by topic, then by the idnumber, ascending (since all records were sorted in the temp table as was desired). Sometimes the simple answers take the longest to figure out.

Thank you for your help!
Feb 16 '10 #5
nico5038
3,080 Expert 2GB
Glad I could help.
Nice to know that someone learned the value of the grouping / sorting thanks to my cryptic directions :-)

Nic;o)
Feb 16 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Shiz | last post by:
I currently have a Form with Option buttons (to give you the option of sorting by name, or by Field, etc), these are referenced in a module which then formats the report contingent on the option...
2
by: Hohn Upshew | last post by:
I need some help to build a report enumerating the products in descending order depending on the sum of liters. In this way i can view the top products sold for a given period.But i fail to do...
1
by: Mike Wiseley | last post by:
I would like to be able to loop through all the report objects in the database and show the recordsource for each and every report, even if the report is not actively open. If I know in advance of...
2
by: Jur Schagen | last post by:
I have this weird sorting problem. I have a report that is based on a query. The query is sorted on field A, and if I run it seperately it is decently sorted on that field. However, if I call the...
1
by: Mike MacSween | last post by:
tblProductions one to many to tblEvents tblEvents contains StartDate I want a report where the data are grouped by tblProductions.ProdID, and sorted by the earliest date in each Production. ...
2
by: ajspacemanspiff | last post by:
I currently have a solution that requires 2 sub queries, where each of them is convereted into a crosstab query and then I join the crosstab queries to a result. I would like to make this more...
6
by: Rob Williamson | last post by:
Does anyone know whether there is a way to create folders inside the right payne when you click on Tables or Queries or Forms or Reports in the the Objects side. I have alot of queries and forms...
9
by: StuckAndNoClue | last post by:
I'm pretty new to Access and VB and also know fairly little (more like nothing) about SQL. I've got three queries that shows similar fields, the main ones being: FIRST QUERY Name ID Active...
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
6
by: Steve | last post by:
I have a 2 unmatched queries Table1_view (records in table1 not in table2) Table2_view (records in table2 not in table1) Both table contain fields ReportID ReportName ReportOwner In_Table1...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
Oralloy
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.