473,414 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How toI change this time duration 1.80 into this 2.20

How do I change this time duration 1.80 into this 2.20 in my DB2 query results

I have a table that gives me time spent in the form of 1.80 meaning 1 hour and 80 min

I have a query that pulls that data but I want the results of my query to take that 1.80 and convert it into 2.20 meaning 2 hours and 20 min.

what should that look like in my query?
Oct 1 '10 #1
1 1900
Brute force, there's probably more elegant ways of doing this:

db2 "with T (n) as ( values 1.80 ) select int(n) + int(100*(n - int(n))) / 60, mod(int(100*(n - int(n))), 60) from T"

1 2
----------- -----------
2 20

Divide the snd part with 100 and add to to the fst.

/Lennart
Nov 23 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Dave | last post by:
I am working with a proprietary database that records the date, time, location, and speed of a vehicle. It is pulling this information from GPS unit tied to a vehicle. The table is populated with...
2
by: Fred Prose | last post by:
Prio to installing FP3 for 8.1 on AIX 4.3 the command LIST APPLICATIONS SHOW DETAIL used to display a timestamp in the "Status Change Time" Column. Since FP3, I get a "Not Collected". As far as I...
2
by: CDF | last post by:
In one of my tables, I have a field that has time durations in it. The field is currently in text format. Is there a way that I can convert this field into a format where I can SUM the durations? ...
3
by: deko | last post by:
having trouble with date calculations... must everything be done with int values? strEnd = (Me!txtEndDate & " " & Me!txtEndTime) 'unbound, formatted as short date and medium time strStart =...
1
by: Muhahid Khan via .NET 247 | last post by:
Can Please some one let me know how can we find out the number of sundays or any specific day with in a specified date duration. I also should get the dates that occur with in the specified date. ...
1
by: Joe J. | last post by:
Hi everyone, I need a little bit of help with this problem. I've got a time durations feed, which comes in this format (minutes:seconds): Example, there is only 5 values: 00:45 01:15
3
by: Dave | last post by:
I'm using VB 2005 Express Edition, and I have added a splash screen using the template provided. I have also identified it in the "Project / Properties / Application" panel. Works like a champ....
3
AccessIdiot
by: AccessIdiot | last post by:
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...
1
mangat
by: mangat | last post by:
Hi guy's i'm stuck in a similar problem. The problem is that i have two fields one shows the LogIn time of the user and other shows the Duration since the user LogIn and now i want to store the...
1
by: vabh | last post by:
I want to change time after 60 seconds,60 minutes as well as date after 24 hours. can this is possible in asp.net using javascript?
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.