I am currently creating a task management system in Microsoft Access 2016 and was curious whether it was possible to create a report or form to show the count of records, the part I can't do is add the record count of two query's. Both query's come from one table but both have different Yes/No property's. The aim of this is to Produce a graph of the comparison between these two results from the number of records.
Query One:
Query Two:
You can use DCount:
RecordCount = DCount("*", "[Quote Won Query]")
Related
I am working on an MS Access report. It is about employee service records. This report asks a parameter which is the ID of the staff member and displays multiple records of its punishments. What I wanted was to skip a serial number of records based on type of punishment. For instance, I do want to skip number for a punishment that contains word 'aside'. So for this, I have added a serial number using a textfield making its control source=IIf([PType] Not Like "*aside*",1,0) its result like this.
The problem here is number 5 is repeating 2 times(as it contains 'aside' string). But I want that highlighted row shouldn't contain any number and next two to it should be numbered 6 which is correct already. My background is from MS SQL server. I can't handle complex VB code.
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.
In my database, I have entered a query page in Design View, and entered the following two headers in separate columns:
MonthsSince: DateDiff("m",[LastContact],Now())
LastContactError: DateDiff("m",[LastContact],Now())
The criteria I'd like to set are: ">6" and "<0"
The >6 criteria filters results so that the user knows that it has been six months since the person in question has been contacted
THe <0 criteria show erroneous dates, specifically if a user put the LastContact date as being in the future
The problem I'm having is that Microsoft Access 2010 merges these two criteria into the rightmost field (LastContactError), and thus no results are returned (there are no numbers >6 and <0).
Even with just the >6 criteria in the MonthsSince field, after one successful search this criterion is moved to the LastContactError field.
Edit 1:
I tried putting on criterion in the "criteria" row, and one in the "or" row, and got the same problem.
Edit 2:
I realised that this single query checks that both the conditions are met, not that either of them are met! The same thing is being compared: LastContact and Now().
Solution:
Create two queries, with separate criteria
Solution: Create two queries, with separate criteria.
Currently, this single query is trying to meet both criteria - which are based off the same comparison. Obviously, it fails.
I'm trying to create a database in Access 2010, and have run into a bit of a problem. I currently have two tables, EarlyStageListResults & ESDailyTotals. Each of these tables has a field named Records, with ESDailyTotals being a summary of multiple entries in EarlyStageListResults. What I need to do is have the Records field in ESDailyTotals be the sum of multiple Records fields in EarlyStageListResults. For example, given the following records in EarlyStageListResults:
Date Records
4/22/16 2000
4/22/16 3000
4/22/16 1500
4/21/16 1200
4/21/16 2700
the records in ESDailyTotals should be:
Date Records
4/22/16 6500
4/21/16 3900
I know this can be calculated later through VBA and a form event, but optimally I'd like to be able to have it update as soon as any of the Records fields in EarlyStageListResults changes. It looks like there may be a way to do this using the Access Macro Editor (not sure of the name, but the tool where you can create a macro through a series of combo boxes rather than through VBA), but I've never gotten an understanding of using that tool, so have always relied on Forms and VBA instead. Basically if there's an event that triggers when a field is updated, and a way to enter VBA code into that event handler like you can with Access Forms, then I can do it with either DLookup or an SQL statement I think, but I don't know how to grab that event handler.
This does all need to be done within Access itself, I can't use an external program to update the records in an Access database file. This is for work, and (officially at least) any custom programs are a big no-no. :)
Thanks in advance everyone!
You're making this way too complicated. You just need one table and a database view (called a query in Access, I think) that is defined as
select Date, sum(Records) as Records from EarlyStageListResults
group by Date
Name the query ESDailyTotals.
I am developing an web app that is reliant on reports being dynamically generated. The client has specified they would like to save reports searches to the database for future use, specifically generating reports from the last 6 month.
I can add the query to the database no bother, the problem is trying to get the date to be dynamic depending on the date the report is ran. The 3 types are bi-monthly, monthly and 6 monthly reports.
My question is:
How would I go about saving the query and getting it to calculate the current date and search based on the report type (2, 3 or 6 month). Is it a simple case of editing the sql query when I pull the query from the database, or would it be easier to split up the query into different parts to make it easier to manipulate/edit later.
Create a second column in your table where you store the query with the dynamic column. Use that column in your dynamic query