Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Access Query Help Please

Status
Not open for further replies.

LemonJello

Technical User
Jun 19, 2003
4
US
I've known Access for a long time but have never needed to create anything in it. I've tried to figure out how to create a query but I must be really dumb because I can't figure out what should be a simple query.
I basically need a query to show how many records were created during certain dates per user.

I've got a table (Main) that has the following fields:
Transaction #
User
Date
Account #
Etc.


I need the query to have the following columns and criteria
User
Number of records per user
Criteria: The query should ask what the from and to dates are.


To help me out the most, it would be nice if your reply would use the names herein:
Main (table that holds the data)
User (table that lists the users)


Thanks alot, cuz I'm stupid and I just can't figure it out.
Aaron
 
What's the common field between your two tables?
Main (table that holds the data)
User (table that lists the users)


I'll assume it's UserID


In the query, drag the columns you want down. They should be at least as you said:

User
Date
Account #
Etc.

Go to View-Totals. Your query rows change a bit.
In the Group by dropdown of your query in the User column, choose "First". On Account #, choose "Count"

See how that goes for ya.

Anne Troy
Way cool stuff:
 
Thanks Dreamboat for the reply! However, the query I need should only have two columns:
User & Count (the number of records per user).

Since the column "Count" doesn't exist in a table, what do I do?
Aaron
 
I got some headway but still having problems. I just need a number of records per user between certain dates.
Here's what I got.
Design view has 2 columns,
Field =Collector
Table = Main
Total = Group By
Sort =
Show = checked

Field = Date
Table = Main
Total = Count
Sort =
Show = checked

The query is great. It shows the collector and the number of records for each person. However, the number represents the total number that's on the whole table. I need it to show the total number of records between certain dates.

If I add a column like so:
Field = Date
Table = Main
Total = Group By
Sort =
Show = unchecked
Criteria = Between [Type the beginning date:] And [Type the ending date:]

This comes incorrect as well because then it lists the number of records per user per date. I just need a number of records per user between certain dates.

Thanks,
Aaron
 
Try this:

Col 1:

Field: Collector
Table: Main
Total: Group By
Show

Col 2:

Field: Collector
Table: Main
Total: Count
Show

Col 3:

Field: date
Table: Main
Total: Where
No Show
Criteria: Between [Start Date:] and [End Date:]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top