change string to customize format on SQL -
i have string format saved on table.the format -
`11/apr/2014 2:30:00 pm-11/apr/2014 4:00:00 pm`.
using format want return customize format while running stored procedure. format should be-
`9.00 10.00 am`.
this i'm trying :
substring(leavemanagement.employeeleavetransaction.period, 12, 5) + substring(leavemanagement.employeeleavetransaction.period, 20, 3) + ' ' + substring(leavemanagement.employeeleavetransaction.period, 36, 5) + substring(leavemanagement.employeeleavetransaction.period, 44, 3)
but returns wrong format if original string have
11/apr/2014 12:30:00 pm-11/apr/2014 4:00:00 pm
can me this.i trying using query
seelct substr(col_name,instr(col_name,' ',1,1)+1,5)|| substr(col_name,instr(col_name,' ',1,2),3) || ' ' || substr(col_name,instr(col_name,' ',1,3),5) || substr(col_name,instr(col_name,' ',1,4),3) table_name
Comments
Post a Comment