Question Locked

Access Query Help

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to extract data from 2 tables, one that I use track Downtime for mutliple plants, each plant has 6 possible events that can be assigned a code from 1 to 11, and an associated time value. The Codes table has an ID field and a Descrition Field. I would like to count the codes that were used during a month and the associated time assigned to each code. I am not sure how to go about this in access?

Help!

4 replies

by maevinn

Something along the lines of

SELECT Month([Date]) & "/" & Year([Date]) AS [Month], Sum(Downtime) AS SumOfFrequency_Years, Code_Description
FROM tblName Inner Join tblDowntime.Code = tblCodes.Code
GROUP BY Code_Description, Month([Date]) & "/" & Year([Date])
HAVING (((Month([Date]) & "/" & Year([Date]))=[enter MM/YYYY]));

As a query, select Make New, add the 2 tables, select the relevant fields. Hit the Totals button, and for the field where you track the length of each downtime, select SUM. Create the feild to extract the Month and Year from the date feild as it's own colum, and enter in the criteria (probably a prompt, something along the lines of putting =[Enter Month/Year] in the criteria feild.

by maevinn

Does the thanks mean it's working? :)

This discussion is closed to new replies.