I have a timing application. Now my clients want milliseconds accuracy added to it.
I have two fields called timestart and timefinish.
I manage to add milliseconds etc with a button from main form (RaceF) to subform (timesf) in the start field in a table (TimeT) using this: - timestart = Format(Now, "dd/MM/yyyy HH:nn:ss") & "." & Right(Format(Timer, "#0.00"), 2)
and when they finish: - timefinish= Format(Now, "dd/MM/yyyy HH:nn:ss") & "." & Right(Format(Timer, "#0.00"), 2)
this is what format looks like:
starttime
finishtime
In a query, how do i subtract these start and finishtimes, getting a result in this format HH:nn:ss:ms or 00:00:00:00
the final result will never be more than 12:00:00:00 (12hrs)
I have added a mini example of my application here.
please help i am stuck
@neelsfer - This will be fairly complicated, so I'll definitely need a little Time. The complexity, at least the way I see it, is having to subtract two TEXT Values which include Milliseconds, representing DATE/TIME Values, then return the Results in a precise Textual Format (hh:nn:ss:ii). Be patient, unless someone comes along with a better idea.
It is a couple of hours later, and I do believe that I have a workable solution. Click on the Timing Query Command Button and view the Results. I'll leave the Testing Phase up to you. See the Attached:
14 3815
I see no easy way to accomplish this since both Time Values are TEXT, and contain a Millisecond Component. I'm assuming that all digits past the Period (.), 51, 92, 78, etc. represent Milliseconds, namely: 51 Milliseconds, 92 Milliseconds, and 78 Milliseconds respectively. Is this assumption correct?
Hi Mr Adezi. Yes i assume it is that. Can one not add it to a "date field" perhaps? I have tried with no success.
I came across this code on the internet. It was from a VB 6 website, and it somehow gives me a millisecond value - is required for a specific type of race in my application that is currently only in seconds. I just need to subtract the start and finish times in this instance.
Any other suggestions on how to add milliseconds to a "datefield" in access.
I have just taken out the date - timestart = Format(Time, "HH:nn:ss") & "." & Right(Format(Timer, "#0.00"), 2)
then i get this ie as starting time
i got this code to generate ms but how to i link it to a button in form to create time in table - #
-
Private Declare Sub GetLocalTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
-
#
-
Private Type SYSTEMTIME
-
#
-
wYear As Integer
-
#
-
wMonth As Integer
-
#
-
wDayOfWeek As Integer
-
#
-
wDay As Integer
-
#
-
wHour As Integer
-
#
-
wMinute As Integer
-
#
-
wSecond As Integer
-
#
-
wMilliseconds As Integer
-
#
-
End Type
-
#
-
#
-
#
-
'usage:
-
#
-
Dim MyTime As SYSTEMTIME
-
#
-
GetLocalTime MyTime
-
-
Dim TimeText as String
-
#
-
TimeText = MyTime.wHour & ":" & MyTime.wMinute & ":" & MyTime.wSecond & "." & MyTime.wMilliseconds
-
-
MsgBox TimeText
I got this code to generate ms but how to i link it to a button in form to create time in table
See the Revised Attachment, I think it says it all.
Thx Mr Adezi; It seems fine to me. Go for it pls
@neelsfer:
Go for it pls
Not sure what you mean, kindly explain...
Sorry, i mean it looks 100% so far, as it adds MS.
Have you got an idea how one will subtract the 2 values?
Thx for your time. Appreciated
I have an idea but I need to know exactly how you wish to display the Results, namely: - 1 min./25 secs./345 millisecs.
- 2 hrs./14 mins./5 secs./13 millisecs.
- 21.87 mins.
- 00:00:23:234 (hh:mm:nn:ii)
- etc.
The best way for me is 00:00:23:234 (hh:mm:nn:ii)
thx
@neelsfer - This will be fairly complicated, so I'll definitely need a little Time. The complexity, at least the way I see it, is having to subtract two TEXT Values which include Milliseconds, representing DATE/TIME Values, then return the Results in a precise Textual Format (hh:nn:ss:ii). Be patient, unless someone comes along with a better idea.
It is a couple of hours later, and I do believe that I have a workable solution. Click on the Timing Query Command Button and view the Results. I'll leave the Testing Phase up to you. See the Attached:
thx mr Adezi. I will test it. i appreciate your time and effort
i have started using the code in my application - works great!! Can't thank you enough Mr Adezi. Just have to add it to my reports, and then its finish!!.
Glad it all worked out for you, neelsfer.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Christophe Cerbourg |
last post by:
hi,
Bonjour,
I'm using PHPMailer class to send mails and it works fine for HTML ones.
But I can't manage to send correctly a text formatted mail...
I tried this :
- $message = "first...
|
by: tdeclercq |
last post by:
HI,
I want to be sure that users receive and can read my mails.
How can I send mail in HTML AND text Format in one send ?
thx
|
by: searider86 |
last post by:
Does anyone know if there is a snippet of code that automatically
removes the wrap text format in excel?
I have an access form that displays data and allows the user to click
on a cmdbutton to...
|
by: Eddy Soeparmin |
last post by:
Hi,
I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On
myGrid1 - Properties - Columns - myColumn1 - Text format string:
I tried to put 'mm/dd/yyyy' in there and it displays...
|
by: jakub.bauer |
last post by:
Hi,
I have a table with in MS SQL database. A table consist a list of items
bought by a customer with, item prices, item nubers etc. I would like to send
an email with a list of items in the...
|
by: Mallik02 |
last post by:
Hi
I am new to MS-Access, I am getting the date in text format when I export it from other application. Could you please explain if there is any "Query" in Access to convert the text dates into...
|
by: yoavyoavyoav |
last post by:
Hi There,
I have some serious issue - I have a .Net application that is generating various reports in CSV format and then fires up excel from code to view this file.
The file is viewed...
|
by: Jeff |
last post by:
Hey
I'm wondering how the Fixed-Width Text Format is
What I know is that the top line in this text format will contain column
names. and each row beneath the top line represent for example a...
|
by: and1 |
last post by:
hello .. hmm currently i'm working on vba in excel, apparently i use ADO to extract a table data from access to excel and it works fine. the problem is when i use the extracted data to create a chart...
|
by: Bill Eberle |
last post by:
In Access 2007 ADP connected to SQL Server Express, most forms allow Text Format attribute of Rich Text, but a few do not.
In each case the SQL Server table field connected to the Access Text Box is...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |