| Author |
Oracle Date Type
|
Nischal Tanna
Ranch Hand
Joined: Aug 19, 2003
Posts: 182
|
|
hi guys.. Actually i m converting sql queries to oracle 1s... So i need some help.. Here i am.. I have a query which gets me the difference between two dates in seconds... select convert(float,datediff(ss,convert(varchar,Shift_Master.First_Punch_Time,108),convert(varchar,Attendance.First_Intime,108)),108) from emp_master,Attendance,shift_master what will be the oracle version of these query.. can any1 help me.. regards, Nischal
|
Thnx
|
 |
Jamie Robertson
Ranch Hand
Joined: Jul 09, 2001
Posts: 1879
|
|
try: SELECT ( date1 - date2 ) *24*60*60 FROM TABLE_1
|
 |
Rudy Dakota
Ranch Hand
Joined: Jul 27, 2002
Posts: 54
|
|
Hi there, I 'll not be solving your problem but I have got two clues for you: - looks like you got your dates stored in character columns You 'll need the TO_DATE function with a nice formatting string to make these values real dates ( - in Oracle SQL the difference between two date values is always a number of days, so you 'll have to multiple it by 24 * 3600 to get seconds. Good luck, Rudy.
|
 |
 |
|
|
subject: Oracle Date Type
|
|
|