This seems like an easy question but I can't for the life of me get it right.
My db users would like to input a time duration, that is the number of hours/min/sec (hh:nn:ss) that a task took. But if I format as time it screws it up. That is, if a task took 24 minutes and 13 seconds and they input 00:24:13 then it goes into the database as 12:24:13 AM.
Is there a way to format number of hours, min, sec without transforming it into a clock time? It would be great if I had a format and an input mask.
Thanks!
3 19837
This seems like an easy question but I can't for the life of me get it right.
My db users would like to input a time duration, that is the number of hours/min/sec (hh:nn:ss) that a task took. But if I format as time it screws it up. That is, if a task took 24 minutes and 13 seconds and they input 00:24:13 then it goes into the database as 12:24:13 AM.
Is there a way to format number of hours, min, sec without transforming it into a clock time? It would be great if I had a format and an input mask.
Thanks!
You are trying to assign a duration in hh:mm:ss format to a Date/Time Field. I don't think it will work. Then following should solve your problem: - Create a Field named [Duration] and set its Data Type to Text.
- Set the following Input Mask for the Field ==> 00:00:00.
- Hours, Minutes, and Seconds can easily be extracted from the [Duration] Field with Calculated Fields as follows:
- Hours: Mid$([Duration],1,2)
-
Minutes: Mid$([Duration],3,2)
-
Seconds: Mid$([Duration],5,2)
- Let me know if this is suitable.
Ahhh, you nailed it. My mistake was thinking it needed to be a date/time field instead of just a text field. That's all I needed!
Thanks! :-)
NeoPa 32,556
Expert Mod 16PB
For anyone trying to follow, I've just moved a new (hijack) question posted in here across to its own thread as How to Round a Duration.
If you ever notice a thread's been hijacked please take a short minute to click on the Report Abuse button. This link is not simply for personally abusive behaviour but covers anything you feel needs moderator attention (Such as hijacks, spam, etc etc).
Thank you for your co-operation.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Bart Nessux |
last post by:
am I doing this wrong:
print (time.time() / 60) / 60 #time.time has been running for many hours
if time.time() was (21600/60) then that would equal 360/60 which would
be 6, but I'm not getting...
|
by: Steven Scaife |
last post by:
I am trying to work out the length of time that a page was opened till it
reached another page, I amusing the script below
End_Of_Call = formatdatetime(now(), 0)
'work out the duration of the...
|
by: Gerry Abbott |
last post by:
Hi All.
How can i put a zero decimal for my currency into my format statement,
== & ", for " & & " days. Cost " &
Format(,"Currency")
which is the data source for a textbox on a report
|
by: John |
last post by:
Hi
I have a start date and a start time field. I also have a timespan value
which can be anything from 5 minutes (TimeSpan(0, 5, 0)) to 2 weeks
(TimeSpan(14, 0, 0, 0)). How can I get an end date...
|
by: martin.roclawski |
last post by:
xsl newbie question: I don't seem to be able to find a simple function
to convert a date in DD/MM/YY format to an integer since Epoch. I have
the DD/MM/YY value in one mySQL database and trying to...
|
by: Arne Gemsa |
last post by:
Hi,
I want to get a starttime. To get this I have to subtract the runtime from a
unit e.g. 08:40:15 from a date e.g. 2007-03-29 16:48:30. So the starttime is
2007-03-29 08:08:15.
Is there any...
|
by: Praveen |
last post by:
DateTime.UtcNow is added as root attribute, 'Modified' of an xml whenever
xml is changed.
Every 5 secs a check is made whether xml is changed or not, by comparing
previous 'Modified' and current...
|
by: veer |
last post by:
Hi
i use Datediff() and it return only hours but i want total time with minutes and seconds at the same time
i use following code for all this and it works fine but when the the time came which i...
|
by: ahmurad |
last post by:
Dear Brothers,
I am struggling the following four Date-Time type values which were inputted into MYSQL database in different tables. As
MYSQL Default Time Format: YYYY-MM-DD HH:MM:SS, So I used...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |