Is there a way to calculate elasped time while making an assumption on the day? For example, i am trying to calculate how long an EOD process take each day. it begins a 8pm (20:00 as it is reported from a system), let’s say last night on 11/29/06. it completed at 1am (01:00) on 11/30/06. The system is not giving date stamp, just short time. The problem is that it does not always completed past midnight. Sometimes the cycle complete earlier on the same day (let’s say for example at 10pm (22:00) on 11/29/06.) Therefore, we cannot assume to identify the end time to be the next day. is there a way to calculate the elapsed time without manually updating the actual complete date?
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Calc time across days not recorded (Access 03 SP2)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Calc time across days not recorded (Access 03 SP2)
- This topic has 2 replies, 2 voices, and was last updated 18 years, 4 months ago.
AuthorTopicWScchambers@work
AskWoody LoungerNovember 30, 2006 at 6:52 pm #437671Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerNovember 30, 2006 at 7:22 pm #1041281You could use an expression like this in a query:
Duration: [EndTime]-[StartTime]-([EndTime]<[StartTime])
where StartTime and EndTime are the time fields. You must explicitly set the Format for this field to Short Time (or whatever time format you prefer).Explanation: ([EndTime]<[StartTime]) is False = 0 if EndTime is later than StartTime, and True = -1 if EndTime is before StartTime. We may assume that if EndTime is before StartTime, it is actually the next day. In that case, we subtract -1 i.e. add 1. Since times are stored as fractions of 1 day, we are adding 1 day = 24 hours.
Example:
StartTime = 18:00 (6 PM), this is stored as 0.75 (18/24 of a day)
EndTime = 3:00 (3 AM), this is stored as 0.125 (3/24 of a day)
EndTime – StartTime = 0.125-0.75 = -0.625. But since EndTime < StartTime, we add 1, giving -0.625+1 = 0.375. This corresponds to 0.375 * 24 hours = 9:00. This is the elapsed time. -
WScchambers@work
AskWoody LoungerDecember 11, 2006 at 4:05 pm #1042949Sorry, I forgot to respond with a confirmation. Your explanation definitely helped! Thanks again.
SELECT EOD_tbl.database, EOD_tbl.date, EOD_tbl.start_time, IIf(([database])=9,[date],IIf([end_time]>=#12/30/1899 20:0:0#,IIf([end_time]<=#12/30/1899 23:59:0#,[date],[date]+1),[date]+1)) AS end_dt, EOD_tbl.end_time, [End_Time]-[Start_time]-([End_Time]<[Start_Time]) AS Dura, Month([date]) AS [month], db_tbl.ID
FROM EOD_tbl INNER JOIN db_tbl ON EOD_tbl.database = db_tbl.ID1;
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
WU help needed with “Some settings are managed by your organization”
by
Peobody
5 hours, 20 minutes ago -
No Newsletters since 27 January
by
rog7
1 hour, 17 minutes ago -
Linux Mint Debian Edition 7 gets OEM support, death of Ubuntu-based Mint ?
by
Alex5723
9 hours, 50 minutes ago -
Windows Update “Areca Technology Corporation – System – 6.20.0.41”
by
Bruce
27 minutes ago -
Google One Storage Questions
by
LHiggins
12 hours, 10 minutes ago -
Button Missing for Automatic Apps Updates
by
pmcjr6142
7 hours, 26 minutes ago -
Ancient SSD thinks it’s new
by
WSila
4 hours, 25 minutes ago -
Washington State lab testing provider exposed health data of 1.6 million people
by
Nibbled To Death By Ducks
20 hours, 9 minutes ago -
WinRE KB5057589 fake out
by
Susan Bradley
13 hours, 28 minutes ago -
The April 2025 Windows RE update might show as unsuccessful in Windows Update
by
Susan Bradley
4 hours, 6 minutes ago -
Firefox 137
by
Charlie
25 minutes ago -
Whisky, a popular Wine frontend for Mac gamers, is no more
by
Alex5723
1 day, 8 hours ago -
Windows 11 Insider Preview build 26120.3863 (24H2) released to BETA
by
joep517
1 day, 8 hours ago -
Windows 11 Insider Preview build 26200.5551 released to DEV
by
joep517
1 day, 8 hours ago -
New Windows 11 PC setup — can I start over in the middle to set up a local id?
by
ctRanger
4 hours, 35 minutes ago -
Windows 11 Insider Preview Build 26100.3902 (24H2) released to Release Preview
by
joep517
1 day, 12 hours ago -
Oracle kinda-sorta tells customers it was pwned
by
Nibbled To Death By Ducks
1 day, 18 hours ago -
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
2 days, 4 hours ago -
Office apps read-only for family members
by
b
2 days, 7 hours ago -
Defunct domain for Microsoft account
by
CWBillow
2 days, 4 hours ago -
24H2??
by
CWBillow
4 hours, 29 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
22 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
4 hours, 19 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
1 day, 3 hours ago -
two pages side by side land scape
by
marc
4 days, 5 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
4 days, 7 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
3 days, 10 hours ago -
Security Essentials or Defender?
by
MalcolmP
3 days, 12 hours ago -
April 2025 updates out
by
Susan Bradley
23 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
3 days, 6 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.