Oracle date formatting tutorial, oracle date tutorial

Source: Internet
Author: User

Oracle date formatting tutorial, oracle date tutorial

Oracle date formatting tutorial

Select 1 as fld_TM_cartons, TO_CHAR (SYSDATE + 1, 'month/DD/YYYY ') as fld_TMD_order_no, nvl (ps. wmps_grossweight, 0) as grossweight, nvl (ps. wmps_cubic, 0)

From table

I want to add a column in the select statement to show that the current system date format is "July 07 2014 AM_BWB_Manifest ".

"How should I write this style? The monthly requirement should be displayed in English, and then AM/PM should be displayed, and _ BWB_Manifest should be added after AM/MP.

To_char (sysdate, 'month dd yyyy hh: miam', 'nls _ DATE_LANGUAGE = 'American ''') | '_ BWB_Manifest'

In this way, you can.

Then it appears again. After the month becomes English, there is a space between it and the date, because its fixed length is 9, so there will be many spaces.

Finally, I changed it. I took out the month separately, trim off the space, and then put it together.

Select trim (to_char (sysdate, 'month', 'nls _ DATE_LANGUAGE = American ') | ''| to_char (sysdate, 'dd yyyy hh: miam ') | '_ BWB_Manifest' as fld_TO_filename from dual;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.