A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Software Craftsman
this week in the
JDBC and Relational Databases
JSP and oracle
Joined: May 29, 2008
Feb 02, 2010 17:04:08
I AM WORKING OUT WITH
query for calculating the time difference in hours with minutes. From these columns shift1,in_punch1,out_punch1 and shift2 ,in_punch2,out_punch2 in oracle?
(WHERE EMPCODE='7010001' AND PUNCH_DATE='01-JAN-10' ; for the whole month of employee..)
i did this query for a single shift but not for
both the shift
select ((to_date(OUT_PUNCH1,'HH24:MI:SS')-to_date(IN_PUNCH1,'HH24:MI:SS'))*24)-8 from act_stipend;
where as 24 for gives whole hours in days and 8 gives extra hours worked beyond 8 hours.
kindly do the help for me.
Author and ninkuma
Joined: Jan 10, 2002
Feb 02, 2010 17:21:53
Please take the time to choose the correct forum for your posts. This forum is for questions on XYZ. For more information, please
This post has been moved to a more appropriate forum.
Also,pPlease be sure to take the time to compose descriptive subjects for your posts;
for more information.
A title such as "ORACLE 10G" is not helpful. What would happen if all posts had such a title?
Please go back and change your post to add a more meaningful subject by clicking the
button on your post.
Asking smart questions
Books by Bear
Joined: May 14, 2008
Feb 03, 2010 09:11:48
The new title is not much better. Think: what are you asking about? Isn't it how to write a query to do time differences? Then why not make that the title? ("Oracle query for time difference")
JBoss In Action
subject: JSP and oracle
Resultset based on current Date and Time
Oracler Date function
Prepared Statement and Date class
Difference between two timestamp fields
Prepared Statement and Date class - Problem still exists
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015