473,396 Members | 2,050 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.

Distinct Record Count

I am using Access 2003 Professional. I have been working with Access for some time and I have created an MDB with a Linked Table and the Data there is temporarily transferred to other Table for different reports. I now have the task of a Daily report which I have been able to get to the point where it does 90% of what I need. I have been searching Google and Answer for the last three days on getting Access to do a Distinct Record Count in a Report and have attempted about 20 Suggestions, but none of them have produced the correct count.

On the report I count the number of Records in a Grouping and I can have from 1 to unknown # instances of the same record, but I need to count it only once. I am fairly competent when it comes to Access, but the Scripting gives my problems when it comes to getting it to work in Access Queries and/or Reports, so basic is best or simple English is also requested.

I greatly appreciate any assistance I can attach the MDB (Empty) if some can tell me how so you can view what is completed.
Sep 13 '07 #1
7 4631
BradHodge
166 Expert 100+
On the report I count the number of Records in a Grouping and I can have from 1 to unknown # instances of the same record, but I need to count it only once. I am fairly competent when it comes to Access, but the Scripting gives my problems when it comes to getting it to work in Access Queries and/or Reports, so basic is best or simple English is also requested.
I would suggest using a Query as your recordset for the report. When in Query Design, right click in the blank table area at the top, and choose Properties, and then Unique Values = Yes.

Then when you design your report, put a Text Box in the group footer that you want, and set it's Control Source to "=Count([YourField]".

That should do the trick for you.

Brad.
Sep 14 '07 #2
I would suggest using a Query as your recordset for the report. When in Query Design, right click in the blank table area at the top, and choose Properties, and then Unique Values = Yes.

Then when you design your report, put a Text Box in the group footer that you want, and set it's Control Source to "=Count([YourField]".

That should do the trick for you.

Brad.
I tried that and it did not work, here is what I have:
I have a Query with Ticket # and Assign_to_Group I then do one Ticket # for the count of the Records.
On the report the Tickets are organized by the Assigned Groups and each update to the Ticket is listed. I then do a Ticket count Unfortunately I get a count of every line on the Report for each Group, but I need it to be Distinct count as each ticket may get several updates by each group.
I have attempted about 20 different Queries with different settings, but they always give the same results (not a Distinct Count).
Thanks for the information so far.
Sep 14 '07 #3
BradHodge
166 Expert 100+
I have a Query with Ticket # and Assign_to_Group I then do one Ticket # for the count of the Records.
On the report the Tickets are organized by the Assigned Groups and each update to the Ticket is listed. I then do a Ticket count Unfortunately I get a count of every line on the Report for each Group, but I need it to be Distinct count as each ticket may get several updates by each group.
I have attempted about 20 different Queries with different settings, but they always give the same results (not a Distinct Count).
Got a couple of questions for you...

1) You said that you have the query with ticket # and Assign_to_Group, and that you assign one ticket # for the count of Records. Is that the count of records for each group? For example would Group A have 3 tasks assigned to them and therefore all three tasks would be under ticket # 100?

2) What is the structure of the query (i.e. what tables or queries is it made up of, and what is their structure with regards to the fields in question)?

Brad.
Sep 14 '07 #4
Got a couple of questions for you...

1) You said that you have the query with ticket # and Assign_to_Group, and that you assign one ticket # for the count of Records. Is that the count of records for each group? For example would Group A have 3 tasks assigned to them and therefore all three tasks would be under ticket # 100?

2) What is the structure of the query (i.e. what tables or queries is it made up of, and what is their structure with regards to the fields in question)?

Brad.
My apologies for the long delay, but did not get to this over the weekend.
The Tickets may be updated by one of the Groups when it is assigned to them. A count would be anytime a Group updates the Ticket, but I need to count a single instance of the Ticket update per group , but also need to show their updates as the day progresses and as work is completed on the Ticket.

The Report comes from a Query with the Table ZRM2DailyT and all 9 of the Fields included. It groups on the Field Assign to Group and Counts the Tickets on Ticket #. I have attempted to get the Query to count Single instances by doing the Unique Record and Unique Value, but neither work. I have attempted to hide Duplicates in the Report, but that only hides that specific fields Duplicate, but counts it anyway since some of them are constant during the update process.

I could attach a copy of the MDB to this message if I knew how; I setup a folder on Friday hoping I could put a copy of it their, but no luck. I think it would be best if you could see the setup and could analyze it that way if that is possible.

Thanks in advance
Sep 17 '07 #5
BradHodge
166 Expert 100+
My apologies for the long delay, but did not get to this over the weekend.
The Tickets may be updated by one of the Groups when it is assigned to them. A count would be anytime a Group updates the Ticket, but I need to count a single instance of the Ticket update per group , but also need to show their updates as the day progresses and as work is completed on the Ticket.

The Report comes from a Query with the Table ZRM2DailyT and all 9 of the Fields included. It groups on the Field Assign to Group and Counts the Tickets on Ticket #. I have attempted to get the Query to count Single instances by doing the Unique Record and Unique Value, but neither work. I have attempted to hide Duplicates in the Report, but that only hides that specific fields Duplicate, but counts it anyway since some of them are constant during the update process.

I could attach a copy of the MDB to this message if I knew how; I setup a folder on Friday hoping I could put a copy of it their, but no luck. I think it would be best if you could see the setup and could analyze it that way if that is possible.

Thanks in advance
So I haven't had time to play around with it, but...

What if you put a check mark on your update form, and it only got a check if the group had not made an update to that ticket yet. Then, you could just count the number of check marks and not the tickets themselves on your report.

You could use a DLookUp statement in VBA to decide whether the box got checked or not. For example...
Expand|Select|Wrap|Line Numbers
  1. If IsNull(DLookup("Check", "tblTicketUpdate", "[TicketID] = '" & TicketID & "' AND [GroupID]= '" & GroupID & "'")) Then
  2. Me.Check=True
  3. End If
The check box could of course be invisible on your form.

Brad.
Sep 18 '07 #6
Brad,
Meant to let you know yesterday, but things got very busy all day. Thanks for the assistance, everything is working great now, your Ideas were very helpful and I know i will also use them in the very near future.
Thanks again,
John
So I haven't had time to play around with it, but...

What if you put a check mark on your update form, and it only got a check if the group had not made an update to that ticket yet. Then, you could just count the number of check marks and not the tickets themselves on your report.

You could use a DLookUp statement in VBA to decide whether the box got checked or not. For example...
Expand|Select|Wrap|Line Numbers
  1. If IsNull(DLookup("Check", "tblTicketUpdate", "[TicketID] = '" & TicketID & "' AND [GroupID]= '" & GroupID & "'")) Then
  2. Me.Check=True
  3. End If
The check box could of course be invisible on your form.

Brad.
Sep 19 '07 #7
BradHodge
166 Expert 100+
Glad to hear it!

Brad.
Sep 20 '07 #8

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

Similar topics

9
by: Kelvin | last post by:
Okay so this is baking my noodle. I want to select all the attritbutes/fields from a table but then to excluded any row in which a single attributes data has been duplicated. I.E. Here's my...
17
by: keith | last post by:
I am trying to get a exact count of different distinct entries in an Access column. At first, I was trying to work with three columns, but I've narrowed it down to one to simplify it. I've searched...
18
by: mathilda | last post by:
My boss has been adamant that SELECT DISTINCT is a faster query than SELECT all other factors being equal. I disagree. We are linking an Access front end to a SQL Server back end and normally are...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
7
by: Johnathan Doe | last post by:
I can google search to find the range of values that can be represented in a float by reading up on the IEEE std, but is that the same as how many distinct values that can go in a float type? ...
2
by: Michael Howes | last post by:
I have a single DataTable in a DataSet. It has 4 columns and i'd like to get a handful of counts of unique items in 3 of the 4 columns. Can a DataTables Select or Compute methods to COUNT DISTINCT?...
2
by: vvyshak | last post by:
Hi all... I have a table in which some columns has distinct values and some has duplicates..i wan to select all the columns with distinct values....no problem if rows has null value in it....i...
1
by: Bill | last post by:
I'm trying to write a query that will select a distinct count of more than one field. I have records that display user productivity. Each of the records have a time associated with it and I want to...
4
by: tom booster | last post by:
Hi All, I'm trying to convert a T-SQl query to DB2. I have two tables policy and policyHolder. I would like a count of the amount of distinct poicyHolders per policy, for a particular set of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.