I am having trouble with zero suppression of the time function. LTRIM(TO_CHAR(S_DATE, 'HH:MI AM'). I'm on 9i. The results looks like this: 08:00 AM. The LTRIM function will remove any set of characters from the left side of the string. Since you did not tell it which set of characters to trim off the string, the LTRIM function will remove any blanks from the left side of the string. The RTRIM function works similarly, but from the right...
side of the string. You are converting a date field to a string and then LTRIM will remove any leading blanks. Unfortunately, with your function, there are no leading blanks. If you wish to remove the leading zero, then you'll need to let LTRIM know this as follows:
LTRIM(TO_CHAR(S_DATE, 'HH:MI AM'),'0')
The second parameter to the LTRIM function tells it to remove the leading zero.
Dig deeper on Oracle database design and architecture
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.