Access how do i create a report that shows how many of same including if only 1 - ms-access

I have a db of some 20k error code entries, and i would like to generate a report that show
how many of each is stored.
The user creates a entry when working on a specific error and they get it from another table
example
I tried creating Queries with the selected data for the report and then using the report wizard to help.
but the SUM function add's the codes together, and the count records counts ALL together.
I am looking to create a report that i group by "Area" which is working fine.
and under each area i den count "example from the screenshot" like this
Error: - >
Do you have any idea's or is there report software that can help me achieve this?
EDIT:
One solution is i found is -
https://support.microsoft.com/en-us/office/count-data-by-using-a-query-b84cdfd8-07ba-49a7-b067-e1024ccfcca8
Count records in a group or category
But then the problem is i am missing a column with the actual reference of the AlarmNo because now i am counting them, and i am still insterested in getting the Original number.
AlarmNo - Count of these.

Sorry i cannot share data or tables not my data.
Allright i found out what i was doing wrong, it was my sql query.
I changed the queries for each area like this.
This one for England, and it now works when i generate a report.
What i was missing was the "Count" AS CountOfAlarmCode.
Thank you for looking anyway.
´´SELECT Data2020.[Country], Data2020.[Site], Data2020.[AlarmCode], Count(Data2020.AlarmCode) AS CountOfAlarmCode, Data2020.[AlarmText]
FROM Data2020
GROUP BY Data2020.[Country], Data2020.[Site], Data2020.[AlarmCode], Data2020.[AlarmText]
HAVING (((Data2020.[Country])="England"));´´

Related

Report builder 3.0 Using Reportitems!TexboxXX.Value sometimes creates multiple boxes. Why?

I have 6 Datasets each one is the same query but has a different WHERE clause based on employee type. They generate 6 tables. At the top of the report there is a summary table which uses reportitems!textboxXX.value to grab the totals for 2 particular fields from all the tables. I'm also using a StartDate and EndDate parameter. Each reportitems! expression in the table comes from a different dataset in the report if that is relevant.
When I run the report using dates from yesterday back to the 9th of May I get the desired output.
But when I go to the 8th I get multiple rows all the same.
and as I go even further back I get even more rows of the same information. To my knowledge nothing interesting or different happened on the 8th of May and the tables further down the report look exactly the same. Any idea what might be causing this? The design view looks like this if that helps. There's no grouping or filters on the table.
Still not certain about the mechanics behind this but I found a 'solution' so I figured I'd post it. I just made a new dataset for my summary tables where the query was simply SELECT 1. Now I get a single row every time.

SSRS - Single page per row

Creating a report that is a display of a persons online application, so there are text boxes and multiple tables per person. I need each person to print on the same page, so a user can select either a particular application, or a date range, like all applications for today and yesterday. I currently have everything in a LIST object with a page break set on it, however the tables in the LIST would throw the "detail member with inner members" error. I found a a way around that using the solution here: http://blogs.lessthandot.com/index.php/datamgmt/dbprogramming/reporting-services-error-the-tablix/ , which got rid of the error, but any multiple row tables return a new row per page, so a person with 3 aliases, will have a 3 page report. So, I am looking for a new tutorial on how to keep everything on one page, but allow my tables to return all results on the same page. Thanks.
I don't know if you are writing the query out or using a stored procedure. If you are using a stored procedure if would make it a lot easier to use SSRS. But to get the grouping correct find a common record between the user and the aliases. Then be sure to pull that common identifier into the stored procedure. Then use the table wizard and pull in all the information you want to see and pull the common identifier into the row group box and it will format for you and group that person on the common identifier and hopefully give you the results you are looking for.

Can't figure how to use lookup() in SSRS 2008 R2

In the report I am building I have 2 data sets: one gives me, per user, per day, the total amount in that status; the other one gives me, per user, how many days in the date range the user actually showed up at work. Each of these data sets comes from its respective stored procedure. See screenshot.
The problem I have is that I need to report not the total time in status per user, but the average per day. So in the screenshot you can see that one user has 5 entries for 5 days worked and the other one has 3 entries for 4 days worked. simply because in one of those 4 days he didn't had that status at all.
I tried adding a calculated field to my "status" data set by using the lookup() function but it kept on giving me errors, which makes me think I don't quite know how to use it.
I also tried using group variables, and I was able to define it under group properties, but it never come up as an option to be used when writing an expression.
Any ideas using lookup(), variables or otherwise?
You're on the right track. Sounds like the Lookup function is exactly what you want.
Instead of trying to add the calculated field to the dataset, try putting it directly in the report item where you want this displayed.
Something along these lines should work:
=SUM(Fields!Available.Value)
/ Lookup(Fields!UserId.Value, Fields!UserId.Value, Fields!Days.Value , "NameOfDaysDataset")
If this isn't working, please post a few more details of your data sets, field names, and where you need this to appear.

MS Access - using multiple queries in 1 report

I have about 35 queries in a large MS Access (2007) database that I would like to use in a report. However, I don't want to create reports for each query, but would rather include multiple queries in one report. The other questions relating to this on SO seem to be related to tables, but I am mainly concerned with just queries.
I have looked at several solutions so far, none of which seem to help:
1) DLookup - returns one value. I need to populate a report with many values from each query.
2) Subreports - I have tried to create text boxes to link my query data, but since they are unbound, it won't let me.
3) Yelling at it. I keep yelling at Access and it doesn't seem to help.
4) One giant query to get the values from all the smaller queries - it doesn't recognize the expressions I built in the smaller queries. Example: CustomerCount = DCount("[Customer_ID]","[Customers]"). Error: 'CustomerCount' is unrecognized.
Any ideas would be greatly appreciated.
Thanks,
If you are creating a report from one query that is made up of multiple subqueries, you can do this by populating textboxes. If looking at the properties on the report > Data tab > Control Source, you would place the name of the your subquery from your giant query and then the value you that you want.
For example:
Master query
SELECT
[Deb<30].CountOfACCT_ID, [Deb<30].SumOfB001,
[Deb<60].CountOfACCT_ID, [Deb<60].SumOfB001,
[Deb<90].CountOfACCT_ID, [Deb<90].SumOfB001,
[Deb>90].CountOfACCT_ID, [Deb>90].SumOfB001,
TodaysHD.CountOfACCT_ID, TodaysHD.SumOfB001,
TodaysLD.CountOfACCT_ID, TodaysLD.SumOfB001,
Part.CountOfACCT_ID, Part.SumOfB001,
FROM [Deb<30], [Deb<60], [Deb<90], [Deb>90], TodaysHD, TodaysLD, Part;
Each of the items in the FROM portion are subqueries being pulled into the master query. Then in your report you would populate the Control Source with [Deb<30].CountOfACCT_ID or whatever value you need from the master query. I have this setup in multiple reports in my application so it should work.
as for 2) you should be able to bind your controls, your subreport should have a record-source.
Else, try listboxes, their graphical apperance isn't exactly flexible, but they might get the job done.
regards,
//t

Report rows differ from SQL result

I am stumped.
I have a select statement that returns the data fine in the data pane, but in the resulting report, one row is our of sort order and falls about 25 rows down in the data where it shouldn't be.
How do I trouble shoot something like that?
Thanks!i
Somewhere in the report you must be sorting the dataset. In this case, the data will look fine in the data pane but will be out of the expected order in the report. Try adding a brand new table to the report and apply the dataset. It should match the data pane.
How do I trouble shoot something like that?
You start by posting the select statement here so we can help without having to hone our psychic debugging skills :-)
It's possible that you're not ordering on every column you think you are. It's also possible that SSRS re-orders the data even after you've retrieved it.
They'd be the first two places I'd look.