Results 1 to 4 of 4
  1. #1
    SteveHale is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    10

    Grouping Times (Half Hour Intervals?)

    Hello everyone.

    (EDIT: This is using Access 2007)

    Requesting aid on how to run something like this (Sample Database attached):

    1. I would like to query all dates in the "CallTime" field wherein the criteria is between #HH:00:00# and #HH:30:00# - Access says I punched in an "invalid date value"


    2. The reason for querying "CallTime" is so that I can get the Total/Sum of "Queue"
    Example:
    GroupName: ChatDudes
    CallDate: 10/1/2015
    CallTime: Between 12:00:00 am and 12:30:00 am
    QueueTotal: 10



    Can this be done via Access or is this where Access takes a backseat and Excel takes over?

    Thanks in advance everyone.

    -Steve
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    add this function , then your query can produce a 'block' based on the time.
    Put the code in a module.
    sql: select [group], getCallBlock([CallTime]) from table

    Code:
    public function getCallBlock(byval pvTime)
        if format(pvTime,"nn") < 30 then
            getCallBlock = "00"
        else
            getCallBlock = "30"
        endif
    
    end function

  3. #3
    SteveHale is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2013
    Posts
    10
    Thanks ranman256!

    Module did what it was meant to do.

    -Steve

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,842
    or use the partition function - see this link

    https://support.office.com/en-us/art...7-c94278274dc5

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help With Grouping By Hour
    By amyjh38 in forum Queries
    Replies: 3
    Last Post: 07-30-2014, 09:04 AM
  2. Replies: 1
    Last Post: 01-31-2014, 11:03 PM
  3. Replies: 1
    Last Post: 10-20-2013, 10:04 AM
  4. Rounding number up to half hour
    By crxftw in forum Forms
    Replies: 2
    Last Post: 08-23-2011, 07:29 AM
  5. Round up time half an hour
    By JBM18 in forum Queries
    Replies: 2
    Last Post: 12-09-2010, 11:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums