Results 1 to 5 of 5
  1. #1
    cmatthews is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Mar 2015
    Posts
    3

    Splitting a record by time stamps


    Hello,

    Brand new to the forum and newish to access. I have a query to look for data that includes a start and end timestamp as seen below.
    shift_date shift_ident equip_ident start_timestamp end_timestamp STATUS_CODE Duration
    10/03/2015 2 2555 5:30:00 AM 7:20:00 AM MEC 6600

    Im looking to break up the data into hours starting on half past the hour. In excel I'm attempting to see how much of this particular status code occurs during each hour interval. The current query shows all 6600seconds under 5.30am. I would like it to show 5.30am to 6.30am and duration as 3600seconds. Then create a second record below from 6.30am to 7.20am and with a duration of 3000seconds.

    I have been told I could use code around the start and end timestamps to create this.

    I'm currently using access 2003 and do most of the work in design view as I'm not familiar with VB.

    Any help would be great. Excuse the lack of programming terminology.

    Thanks

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Could you describe to readers in simple terms, what the business rationale for this is?
    Many times people want total time to do such and such.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    you will want to research the DateAdd method along with probably DateSerial - - - you will find good documentation and much Q&Q... then using these methods in a query one can calculate what you need.... they haven't changed since 2003 or before and are universal so you don't have to worry about any version specific issues......

  4. #4
    cmatthews is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Mar 2015
    Posts
    3
    I have thousand of records, with multiiple equipment in multiple status codes. I'm trying to see how much time is allocated to each status code for each hour across all equipment IDs.
    Example
    Between 5.30am and 6.30am in start timestamp there may be 3 equipment id's that had a duration of 20 min and 1with a duration of 6 hours. I need the records to be split so when I group the data in excel it will show 5.30am to 6.30am - 2hours, then 6.30am-7.30am - 1hour, 7.30am to 8.30am - 1 hour etc. So that 6hours is broken down into an hour per time interval.


    Does that make more sense?

  5. #5
    cmatthews is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Mar 2015
    Posts
    3
    Thank you very much for that advice Nic

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

Similar Threads

  1. Creating Multiple Time Stamps
    By pjstrat00 in forum Forms
    Replies: 4
    Last Post: 06-16-2014, 03:52 PM
  2. One record at a time
    By iceruam in forum Queries
    Replies: 2
    Last Post: 09-18-2012, 08:46 AM
  3. Replies: 4
    Last Post: 07-22-2011, 12:52 PM
  4. Splitting one record into multiple records
    By AccessUser123 in forum Programming
    Replies: 4
    Last Post: 06-15-2011, 08:18 AM
  5. problem in splitting Date and time fields
    By swaroop1012 in forum Queries
    Replies: 1
    Last Post: 11-22-2008, 11:29 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