You are here:

Using MS Access/Filtering Table using two time slots

Advertisement


Question
Hi Scott,

I thought this might be easy, but I cannot find a credible answer anywhere.   I want a query that will (Totals) count all events in a table where the time falls between 6:00 am and 9:29:59 am.   The field I am using is called EventDate, and is a General Date.  It's automatically generated when someone starts a new record.

Any clues please?   SQL is fine...

cheers
Pete

Answer
Does the EventDagte field include both date and time? If so, I would use an interim query that add a column like:

EventTime: TimeValue([EventDate])

Then use that query in your Totals query and set the criteria to:

BETWEEN #6:00 AM# AND #9:29:59 AM#  

Using MS Access

All Answers


Answers by Expert:


Ask Experts

Volunteer


Scottgem

Expertise

I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.

Experience

I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Organizations
Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Education/Credentials
Brooklyn College BA

©2016 About.com. All rights reserved.