Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Need to find short months ie JAN, FEB, MAR

New Here ,
May 20, 2011 May 20, 2011

Hi

Just a little problem:

I have the following query:

SELECT MONTHNAME(year) AS Month

FROM features1

which return the Month as JANUARY

I would like to get a shorter version of the month ie JAN

any ideas?

TOPICS
Server side applications
494
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 20, 2011 May 20, 2011

Think I just figured it out:

SELECT LEFT(MONTHNAME(year),3) AS Month,

FROM features1

Using LEFT: Returns the leftmost number of characters as specified by the amount (in this case 3)

Woot

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 20, 2011 May 20, 2011
LATEST

echo substr($query_row['Month'], 0, 3);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines