About Time

10 pts.
Tags:
Oracle
PL/SQL
SQL
SQL Server
Hi Everyone,

I need a PLSQL query inorder to keep track of TIME.

Scenario : The Time Performed should be before the Other Time.

Regards,

Pet

 



Software/Hardware used:
OC

Answer Wiki

Thanks. We'll let you know when a new response is added.

A lot more info is needed…

There are so many date / time functions available. Also are you taking inputs directly or selecting from tables?

Here are a few to get you started:

SELECT TO_DATE(’01/01/1900 00:59:59′,’mm/dd/yy hh24:mi:ss’)
, SYSDATE
, to_char(sysdate, ‘HH:MM:SS’)
, TO_CHAR(SYSDATE + 1/(24*60*60),’HH24:MI:SS’)
from dual;

day_elapsed := 24*EXTRACT(DAY from (time_out – time_in));
hr_elapsed := EXTRACT(HOUR from (time_out – time_in));
min_elapsed := ROUND(1.6667*EXTRACT(MINUTE from (time_out – time_in)),0);
time_elapsed := TO_NUMBER((day_elapsed + hr_elapsed) || ‘.’ || min_elapsed);

SELECT (time_out – time_in) Time_performed
, time_in
, time_out
from xx_table

Add details to the discussion and maybe we can be more specific

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following