Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql language - sql query 1

Status
Not open for further replies.

LinuXelite

Programmer
Jun 21, 2002
150
CA
Hi!


When I do this sql query

SELECT MONTHNAME(f_date) from table1;
I get

NOVEMBER.. DECEMBER ... and so on..

I want to get this but in french or spanish...

Is it possible? Only with SQL?

THank you
 
I think monthname() only returns English -- at least I could never discover a way to do it.

I used a workaround. I created a table called months_i18n which looked like:
Code:
+--------------+------------+-----------+-----------+
| month_number | spanish    | french    | german    |
+--------------+------------+-----------+-----------+
|            1 | Enero      | Janvier   | Januar    |
|            2 | Febrero    | Février   | Februar   |
|            3 | Marzo      | Mars      | März      |
|            4 | Abril      | Avril     | April     |
|            5 | Mayo       | Mai       | Mai       |
|            6 | Junio      | Juin      | Juni      |
|            7 | Julio      | Juillet   | Juli      |
|            8 | Agosto     | Août      | August    |
|            9 | Septiembre | Septembre | September |
|           10 | Octubre    | Octobre   | Oktober   |
|           11 | Noviembre  | Novembre  | November  |
|           12 | Diciembre  | Décembre  | Dezember  |
+--------------+------------+-----------+-----------+

Then your query becomes:

Code:
SELECT spanish from table1, months_i18n where month(f_date) = month_number;
Want the best answers? Ask the best questions: TANSTAAFL!
 
Thank you for your advice. I'll use it for sure ;o)

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top