Solved

MS Access get count of incidents each hour of day

Posted on 2016-09-03
6
25 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
  • 3
  • 2
6 Comments
 

Author Comment

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

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 49

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 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 41783077
thanks, Gustav, for the assist.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now