473,378 Members | 1,372 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,378 software developers and data experts.

Filter Report by Group Header?

I have a report based on the below query/table:

Parent Record - Child Record - Ref
Alarm A1 - Alarm A1 - 1
Alarm A1 - Alarm B2 - 2
Alarm A1 - Alarm A2 - 1
Alarm D1 - Alarm D1 - 3
Alarm D1 - Alarm D2 - 3
Alarm D1 - Alarm C4 - 4

The child records are alarms that happen with 5 minutes of the parent alarm, but not all are related. Basically I group by the Parent Record in a group header, and then show the related records below it.

What I am aiming for is to only show records with the same reference as the parent record.

So for the parent record Alarm A1, it would only show Alarm A1 and Alarm A2.

The tables are very big, and it takes a few queries to get to the stage above.


Any ideas anyone?

Thanks in advance
Gareth
May 8 '14 #1

✓ answered by jimatqsi

Gareth, the number of records is, for the moment, unimportant. The number of tables may be important, but how many tables can 3 data items be in? If you have implemented several queries prior to this report then that's important because you have the chance to shape the data appropriately for the report.

Maybe you should start at the beginning and let someone here help you with those queries. I suspect you may be making your problem harder than it is. There's an awful lot about data extraction that you have to learn the hard way, through experience. We can help with that.

Jim

10 1868
jimatqsi
1,271 Expert 1GB
Gareth,
Your situation is not very clear. I think you are saying all this data is in one table. It's not clear at all what your table of data means.

Can you not simply join the two alarm events on reference number? What prevents that from giving you the related alarms you want?

Jim
May 8 '14 #2
The above table is the result of 4 previous queries and finally a union to get to this stage. The data tables have millions of records.

Effectively all I am trying to do is only show child records that have the same reference as the parent record. The problem is the data above has thousands of records alone and they are grouped in date order currently. If I group by reference as well then it messes up the ordering and groups alarms at different times together.

Hope this makes sense :)

Gareth
May 8 '14 #3
zmbd
5,501 Expert Mod 4TB
You really haven't given us enough detail to answer the question.

You have however, given enough information so that I'm in agreement with Jim here... sounds like your database is very
poorly designed to handle the data.

Please read thru:[*]> Database Normalization and Table Structures.

The sooner you normalize your database the better!
May 9 '14 #4
:) Apologies if I havent explained the issue or the design very well. The databases are in a corporate SQL environment with hundreds of users, a high number of related tables, and millions of records. The databases run from dual servers with a high number of complicated jobs and reports running every day. This query I am working on is very complicated to even get this far, and I've nearly got the solution to the last piece of this puzzle.

I appreciate you both taking the time to reply, however I'm not sure its a good thing to assume a database is poorly designed based on the brief outline of the issue above.
I did mention the tables were very big which would indicate there were multiple tables and likely to be joined etc.

I appreciate it would be difficult to answer this question however with the limited info I can give, so I'll work it out :)

Thanks again
Gareth
May 9 '14 #5
jimatqsi
1,271 Expert 1GB
Gareth, the number of records is, for the moment, unimportant. The number of tables may be important, but how many tables can 3 data items be in? If you have implemented several queries prior to this report then that's important because you have the chance to shape the data appropriately for the report.

Maybe you should start at the beginning and let someone here help you with those queries. I suspect you may be making your problem harder than it is. There's an awful lot about data extraction that you have to learn the hard way, through experience. We can help with that.

Jim
May 9 '14 #6
The above data items are really the only ones that have any relevance to the issue. There are many others but again I probably didnt explain very well :)
I have fixed the issue a few steps before I get to this stage. Basically I linked the Parent record to the Reference at the start of the process as well as to the child records at the end so that I effectively had a Parent ref as well like below

Parent Record - Child Record - Child Ref - Parent ref
Alarm A1 - Alarm A1 - 1 - 1
Alarm A1 - Alarm B2 - 2 - 1
Alarm A1 - Alarm A2 - 1 - 1
Alarm D1 - Alarm D1 - 3 - 3
Alarm D1 - Alarm D2 - 3 - 3
Alarm D1 - Alarm C4 - 4 - 3

All I had to do then was say show me any records where the child ref = the parent ref which removed the records not related. I over simplified the whole process to try and explain the issue which made it almost impossible to answer really :)

Thanks all again
Gareth
May 9 '14 #7
jimatqsi
1,271 Expert 1GB
Great, that's the best solution of all, when you're able to drill down to your own fix. Way to go.

Jim
May 9 '14 #8
ZMBD: Just to reply to your PM this morning, its all sorted when I replied yesterday afternoon. I fixed the issue by linking the parent record with the reference before I even got to this stage. I over simplified the whole process to try and explain the issue which made it almost impossible for you to answer really. Its all working perfectly now.

Thanks again
May 10 '14 #9
zmbd
5,501 Expert Mod 4TB
I've reset the best answer because if the detail of information provided in Post #7 had been provided to begin with Jim, One of the other experts, or myself would have been able to help you to the solution.

If anything, it would appear that Post #6 prompted you to review your work; thus, leading to your solution.

For that reason I have selected post #6
May 10 '14 #10
I agree I had to review my work as I still didn't have a solution :) but I have no problem you picking whatever answer you want if it helps.

Its all sorted now, on to the next one :)

Thanks
May 10 '14 #11

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...
0
by: Pat S | last post by:
I have a report in which each record is about work booked to be done by my company for a client. Each day of work is represented by one record. The report is grouped by CLIENT -- so each page...
2
by: Simone | last post by:
Hello. I am using the code below: ------------------------------------------- Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.Section(0).BackColor = vbWhite Then...
6
by: Chuck | last post by:
I have a report with three columns, accross then down, and two groups. Currently the group headers are only one column wide and appear in the left hand column. How can I make the group header be...
3
by: Greg Teets | last post by:
I used the Report Wizard to create a report that is generally working pretty well. However, it set up the structure as follows: Report Page Header Group 1 Header - Header for the group Group...
1
by: David Horowitz | last post by:
Hi folks. I need to create a report that has a Group Header that pulls certain data from the Detail section. It's something like this: +--Report---------------------------------------- |...
4
by: LF | last post by:
Hello, I have a database with a table of projects and a table of tasks (each project can have multiple tasks). I have a report that has a group header for the project name, etc., and then the...
1
by: lmawler | last post by:
Hi, I am trying to make a report which groups together parents and their children. I have three levels. I currently have three group headings and one detail section. I have some fields that...
4
by: DavidB | last post by:
Im not sure if I am missing something obvious here or not so excuse me if this is a DFU question please... I have a report I am working on that includes the following data. Agency Name Vendor...
1
by: franc sutherland | last post by:
Hi, I am using Access 2003. I have set up an invoice in a report. I have set up the name and address as text boxes in the Page Header which I've made as small as possible then set the Can...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.