Question

Locked

Access Query Help

By Hunter_Lake ·
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!

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

HTH

by Maevinn In reply to Access Query Help

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.

Collapse -

Thanks

by Hunter_Lake In reply to HTH

Excellent advice, thank you!

Collapse -

Glad to help!

by Maevinn In reply to Thanks

Does the thanks mean it's working? :)

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums