Home » SQL & PL/SQL » SQL & PL/SQL » Date
Date [message #568700] Tue, 16 October 2012 00:41 Go to next message
xerox2012
Messages: 15
Registered: October 2012
Junior Member
For an entered date, I want to hardcode the time part as 18:00:00, and rest of the date should be whatever is passed as input, how can i do this?
Re: Date [message #568702 is a reply to message #568700] Tue, 16 October 2012 00:47 Go to previous messageGo to next message
muralikri
Messages: 638
Registered: August 2011
Location: chennai
Senior Member

You are excepting this one..

select to_date('10/12/2012'||'18:00:00','mm/dd/yyyy hh24:mi: ss') from dual
Re: Date [message #568704 is a reply to message #568702] Tue, 16 October 2012 01:11 Go to previous messageGo to next message
xerox2012
Messages: 15
Registered: October 2012
Junior Member
My in parameter is as below :
in_sdate IN DATE DEFAULT (SYSDATE) - 1
I will now convert this in_sdate to CET format as
v_convert_date := f_convert_tzs (in_sdate, 'EST5EDT', 'CET');
Now again I calculate start date as
v_sdate := TRUNC (v_convert_date, 'MM');
which gives first of that month . Now I should get data from first of that month from 18:00:00 hrs only, not from 00:00:00
so i want to hardcode that 18:00:00 in my v_sdate , how can i get that?
Re: Date [message #568706 is a reply to message #568704] Tue, 16 October 2012 01:14 Go to previous messageGo to next message
Michel Cadot
Messages: 59147
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
I should get data from first of that month from 18:00:00 hrs only


v_sdate := TRUNC (v_convert_date, 'MM') + 18/24;

Regards
Michel

Re: Date [message #568707 is a reply to message #568706] Tue, 16 October 2012 01:22 Go to previous message
xerox2012
Messages: 15
Registered: October 2012
Junior Member
Thanks a lot Smile
Previous Topic: Filtering
Next Topic: code to load data from text to table ?
Goto Forum:
  


Current Time: Sun Sep 21 05:10:46 CDT 2014

Total time taken to generate the page: 0.07413 seconds