I am stuck with a Oracle query. In my dashboard app, we have to show a summary graph for total of details lines basically. In one particular tab, we need the datetime in the details, but we group on the summary by date only.
How to convert date(string type) into date(date time ) in oracle. I am using select within select in other words nested select. Inner query returns string date time, and outer query unable to convert this to date time
You would use the to_date
function to convert a string to a date. For example
to_date( '2012-12-25 13:45:56', 'yyyy-mm-dd hh24:mi:ss' )
or
to_date( '12/25/98', 'MM/DD/RR' )
The format mask that you pass in as the second argument will depend on the format of the string. The set of valid format masks for the to_date function is in the documentation.
You can use TO_DATE function.
For e.g:
If the input string in in the form 12/21/2012
You can try TO_DATE('12/21/2012', 'MM/DD/RRRR')
Check this link for more on variou formats: http://psoug.org/definition/TO_DATE.htm