473,321 Members | 1,877 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,321 software developers and data experts.

rounding milliseconds to seconds in db2

How to convert the timestamp to nearest seconds.
example i am having date value as 2012-11-28 13:03:18.981
and it needs to be rounded to 2012-11-28 13:03:19 in DB2 select query
Nov 29 '12 #1
4 5044
Rabbit
12,516 Expert Mod 8TB
You can use the Round function.
Nov 29 '12 #2
I tried the below query for rounding the timestamp:
SELECT ROUND_TIMESTAMP('2008-10-16-14.46.22.121222','MI')
FROM SYSIBM.SYSDUMMY1

but it is not working i am getting the below error message:
SELECT ROUND_TIMESTAMP('2008-10-16-14.46.22.121222','MI') FROM SYSIBM.SYSDUMMY1
SQL0440N No authorized routine named "ROUND_TIMESTAMP" of type "FUNCTION"
having compatible arguments was found. SQLSTATE=42884

SQL0440N No authorized routine named "ROUND_TIMESTAMP" of type "FUNCTION " having compatible arguments was found.
Dec 4 '12 #3
Rabbit
12,516 Expert Mod 8TB
I don't know where you got ROUND_TIMESTAMP from because that's not what I said. I said ROUND.
Dec 4 '12 #4
Anas Mosaad
185 128KB
Hi Rabbit,
ROUND_TIMESTAMP does exist in 9.7 & 10.1 LUW.
Jan 5 '13 #5

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

Similar topics

15
by: mjs7231 | last post by:
I am trying to record how long an operation takes, but can't seem to find a function that will allow me to record the timestamp in milliseconds, maybe I am looking in the wrong place?
11
by: S_at_work | last post by:
hello, can anybody give me a piece of code , or a hint , how i can recieve the time i need for connect() to another host in milliseconds. My problem is i want test the performance of...
2
by: Harlin Seritt | last post by:
How can I take a time given in milliseconds (I am doing this for an uptime script) and convert it to human-friendly time i.e. "4 days, 2 hours, 25 minutes, 10 seonds."? Is there a function from the...
2
by: Rajat | last post by:
Hi, I have to draw a real time chart in which I have several entries at the same second (i.e. HH:MM:SS:Milleconds) The charting component only takes julian date for drawing the dates. I am...
3
by: Mark | last post by:
I'd like to compare two datetime values in milliseconds. The datetime.compare method appears to show only seconds. Milliseconds of a datetime are available as a property of each datetime, but I...
4
by: Deniz Dogan | last post by:
Hello. I need help with a small problem I'm having. I want to make a function which takes an integer representing some time in milliseconds and returns the same time but formatted as...
4
by: pks83 | last post by:
In MSSQL I am using datetime as the column type and trying to execute the below mentioned query select time from tickets where ticket_id = '1'; when i execute the query on sql manager window it...
3
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hello - I have various times formatted like 00:00:00, so for example, 01:32:05 would be one thirty-two with five milliseconds. I need to convert this into seconds (an integer). First of...
24
by: Joe, G.I. | last post by:
Hi all, I'm trying to generate about 50 numbers as milliseconds between 0 and 4 seconds and it's driving me crazy. Can anyone help out on how to do this? Any help much appreciated.
1
by: ndedhia1 | last post by:
I was reading in a log file like this that had no milliseconds: QuoteBlockTiming exceeded 1 ms: 1 --- Thu Dec 10 02:01:40 CST 2009 170.137.15.155 Class key = 601650761 block size QuoteBlockTiming...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.