on 12-02-2014 12:33 PM
Hi,
In one of my project we have requirement to check the time field column<= time field column+ 2 hrs,here my problem is without converting timefield column into datatime filed i couldn't add the 2 hrs time. is there any function in hana to add directly time into timefiled column.
Regards,
Harish
Did you try ADD_SECONDS?
Regards,
Krishna Tangudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shure you can!
Just try one of this examples:
1) select to_nvarchar(to_time(add_seconds(to_timestamp(endtime,'HH12:MI:SS PM'),7200)),'HH12:MI:SS AM') from
(select '04:30:15 PM' as endtime from dummy)
2) select to_time(add_seconds(endtime,7200)) from
(select '04:30:15 PM' as endtime from dummy)
The first is format example, and the second is default formatting.
to_nvarchar function is for clear understanding;)
Hi Lars,
I have already tried the solution what you suggested. When i add 1 hr to the time field it will works but when i try for 2 hrs it will give following error
numeric overflow: search table error: [6944] AttributeEngine: overflow in numeric calculation;secondtime [here]add_seconds(secondtime "ENDTIME", int '7200'),ENDTIME = 23:45:00[secondtime]
Regards,
Harish
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.