How about:
SELECT Hour(OpsTime) As OpsHour, Count(OpsTime)
FROM MyTable
GROUP BY Hour(OpsTime)
I thought the Partition function might also work to give you a range, but
Help says it works only with whole numbers, and a time value is a fraction
of a day.
John Viescas, author
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
Running Microsoft Access 2000
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
For the inside scoop on Access 2007, see:
http://blogs.msdn.com/access/
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Dave Moreau
Sent: Sunday, April 30, 2006 6:22 PM
To: Access Newsgroup (E-mail)
Subject: [ms_access] Time calculations for flight operations
I have a field that is listed as "OpsTime". It is the time a flight either
arrives or departs our airport.
I am interested in grouping all times as a total Ops per hour for a graph in
Access but am having a difficult time trying to determine how to do this in
one query (if this is possible). I imagine a count function will be the
appropriate calculation.
Is this a good problem for a crosstab query to solve..... or is there
another way to sort all flight times and group them by the hour for a total
number of ops per hour? In such a manner that I can graph the results?
(all flight times are military times)
OpsTime
07:00
07:10
07:30
08:00
08:05
08:15
08:20
08:40
08:45
08:50
08:55
08:55
This group of times will provide the following results if the query works as
I hope:
0700 to 0759 = 3
0800 to 0859 = 9
I will use the numbers per hour of flight ops to produce a line graph
showing flight activity peaks and valleys throughout the day.
Thanks for any ideas!
Dave
This e-mail and any attachments may be confidential or legally privileged.
If you receive this message in error or are not the intended recipient, you
should destroy the e-mail message and any attachments or copies, and you are
prohibited from retaining, distributing, disclosing or using any information
contained herein. Please inform us of the erroneous delivery by return
e-mail. Thank you for your cooperation.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
SPONSORED LINKS
| Microsoft access database | Database development software | Database management software |
| Database software | Inventory database software | Membership database software |
YAHOO! GROUPS LINKS
- Visit your group "ms_access" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
