on 11-16-2007 8:55 AM
Hi All,
I want to display "from_time" and "To_Time". Is there a datatype which helps to display the "time alone"? The data type called "Timestamp" is displaying both date + time.
Could anyone say the datatype for this?
Regards,
Divya
Hi Divya
There are three datatypes in oracle for time: DATE, TIMESTAMP and INTERVAL. You need to be a bit more precise on what you want to do.
But just some general hints:
- Example: you can display only the hour:min out of a date or timestamp type with to_char(mydate, 'HH24:MI:SS')
SQL> select to_char(sysdate,'HH24:MI:SS') from dual;
- In the SAP world date fields are mostly VARCHAR2 types like '20071116104417' . You can extract the time with substr(mydat,9,6) will take 6 characters from string position 9:
SQL> select substr('20071116104417',9,6) from dual;
- You can subtract to dates / timestamps and will end up with an interval. Subtracting two dates gives you just a number, which is no longer a date.
Regards Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you should ask in a ABAP forum.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.