Results 1 to 4 of 4
  1. #1
    chrisorona is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    2

    Getting a Quarterly Query to Start at 1200AM and end at 1159PM

    I am trying to run a Quarterly Query using the date format m/dd/yyyy hh/mm/ss am/pm. I have events that start at the end of the quarter and run into the next quarter and I need these separated. I need the query to start at 12:00:00am on the first day of the query and end at 11:59:59 on the last day of the quarter. I am trying to determine the amount of hours have elapsed per event within that quarter. Below are the Functions I am using.

    To determine the Quarter I Want I am using-------------Quarter: DatePart("q",[BeginTime],[EndTime])
    to determine the Duration of Event I am Using-----------Duration: ((Round((DateDiff("n",[Begintime],[EndTime])/60),2)))



    Thank you,

    Chris

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is the issue? What is not working? Is there an error message, wrong results, nothing happens?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    chrisorona is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2014
    Posts
    2
    I am getting improper results. An example of this is I have an event that starts on 9/30/2014 at 4:30 PM and goes until 10/8/2014 at 10:40pm I am trying to only get the hours that occurred on 9/30/2014 because the quarter ends that day and the next quarter begins the next day.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Yes, records that encompass a range that crosses some demarcation point (daily, weekly, monthly quarterly, etc) are always a frustrating complication. I have tried to help with this sort of issue before and it never gets easier. Requires taking the record range dates and testing if they are beyond the desired range parameters and then deducting any extra hours. Doing this analysis within a query is nearly impossible and probably will require a custom function.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2014, 12:20 PM
  2. Quarterly Satisfaction Report
    By DanRob in forum Reports
    Replies: 1
    Last Post: 04-25-2014, 05:42 PM
  3. Query to calculate quarterly growth rate.
    By gromit1 in forum Queries
    Replies: 15
    Last Post: 03-07-2013, 04:00 PM
  4. quarterly calculation
    By jamo in forum Queries
    Replies: 7
    Last Post: 11-20-2012, 06:59 PM
  5. Quarterly Amounts
    By Brian62 in forum Queries
    Replies: 9
    Last Post: 10-16-2009, 02:18 PM

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