Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access get count of incidents each hour of day

Posted on 2016-09-03
6
Medium Priority
?
42 Views
Last Modified: 2016-09-03
Dear Experts,

Okay...need some help with this one. I am trying to graph the number of incidents within each hour.

The image below shows my query as it is now. I can group the times but what the users want to see is what time during the day do more incidents occur. For example between 9:00am and 10:00am there were eight incidents and between 10:00am and 11:00am there were 3 incidents. I only need to track from 7:00am until 4:00pm each day.
screenshotscreenshot1Is this possible if and so how do I set my query up?

Thanks!
0
Comment
Question by:shogun5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:shogun5
ID: 41782855
...and when I add the date and sort....
screenshot2
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 41782927
how about something like:

SELECT stdID, Hour(stdBehaviorTime) as BehHour, Count(ID) as Incidents
FROM tblStudentBehaviors
WHERE Hour(stdBehaviorTime) >= 7 and
AND Hour(stdBehaviorTime) < 16
AND stdID = "12345"
GROUP BY stdID, Hour(stdBehaviorTime)
0
 

Author Comment

by:shogun5
ID: 41782930
Thanks Dale but I am getting this....
screenshotDon't exactly know where the syntax error is....
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:Gustav Brock
ID: 41782943
Don't exactly know where the syntax error is....

Are you serious? Read the error message again ("and" again if needed).

/gustav
0
 

Author Closing Comment

by:shogun5
ID: 41782944
Nevermind..found the extra .and.  Thanks again Dale! Worked great!
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 41783077
thanks, Gustav, for the assist.
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question