Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Access get count of incidents each hour of day

Posted on 2016-09-03
6
Medium Priority
?
47 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 49

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 52

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 49

Expert Comment

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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Suggested Courses

927 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