aspose file tools
The moose likes Oracle/OAS and the fly likes Oracle Date Type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Reply Bookmark "Oracle Date Type" Watch "Oracle Date Type" New topic
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Oracle Date Type
 
Similar Threads
SQL Server - convert large number to string problem
how to convert?
Minus Operation Query
having problem with a stored procedure used called by a DAO
how to write hibernate query for complicated oracle query