Taking time from current day/month/year 06:00:00 to sysdate(Current Time) [message #662847] |
Sat, 13 May 2017 02:42 |
|
baranwalb
Messages: 2 Registered: May 2017
|
Junior Member |
|
|
Sir,
I have a table 'disturbance' in which mill_start_time and mill_stop_time has values
I want to know the delay from start of morning shift. Here morning shift starts from 06:00 hours. So I write a query as given below
select D.DISTBEG Mill_Stop,D.DISTEND Mill_Start ,(D.DISTEND-D.DISTBEG)*1440 down_Minute from disturbance d
where D.DISTBEG between to_date('13-05-2017 06:00:00','dd-mm-yyyy HH24:MI:SS') and sysdate
In the above query I have to feed current date as 13-05-2017. I want to replace it with sysdate's day-mm-yyyy. How can I modify my query?
Thanks in advance.
|
|
|
Re: Taking time from current day/month/year 06:00:00 to sysdate(Current Time) [message #662850 is a reply to message #662847] |
Sat, 13 May 2017 05:19 |
|
Michel Cadot
Messages: 68693 Registered: March 2007 Location: Nanterre, France, http://...
|
Senior Member Account Moderator |
|
|
Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.
With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
If I understand what you want is the current date at 00:00:00, then:
TRUNC(SYSDATE)
If you want the current date at 06:00:00, then just add 6/24 to the previous expression.
|
|
|
|
|