Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:00:42+00:00 2026-06-06T20:00:42+00:00

I am using this query to produce a blog archive menu, like so: SELECT

  • 0

I am using this query to produce a blog archive menu, like so:

SELECT CONCAT( MONTHNAME(published) , ' ' , YEAR(published)) AS monthyear, 
COUNT(*) AS total
FROM blog_articles
WHERE status = 'Online' AND Year(published) = 2012
GROUP BY CONCAT( MONTHNAME(published) , ' ' , YEAR(published))

Expected result:

January 2012        103
February 2012       87
March 2012          23
April 2012          99

Actual result:

enter image description here

The count is correct but instead of the mental oriental, it should read:

May 2012       1

How can I get rid of the funny characters and have English instead?

When I run this query in phpMyAdmin, the characters are fine.

UPDATE

I have just tried running conn.Execute(“SET lc_time_names = ‘en_US’;”) and didn’t solve the problem. To check, I used conn.Execute(“SELECT @@lc_time_names;”) and it returned “en_US”.

ANOTHER UPDATE

Searching on MySQL forums for related issues, I found another guy whining about the same issue. A MySQL guru said:

“This is the famous (infamous) server returns wrong types for CONCAT
of a number and a string. One has to use the (cast) form for this to
work, the driver can’t tell what the real type is.”

I’m not sure what cast is or how to fix this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:00:44+00:00Added an answer on June 6, 2026 at 8:00 pm

    Silly server, math is for numbers.

    CAST() CAST(enum_col AS CHAR) – cast a value as a certain type

     SELECT CONCAT( CAST(MONTHNAME(published) as char) , ' ' , CAST(YEAR(published)) as char) AS monthyear, 
     COUNT(*) AS total
     FROM blog_articles
     WHERE status = 'Online' AND Year(published) = 2012
     GROUP BY CONCAT( MONTHNAME(published) , ' ' , YEAR(published))
    

    DATE_FORMAT() You might also try DATE_FORMAT(YEAR(published), ‘%Y’) function instead of CAST.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this query: SELECT DISTINCT pat.PublicationID FROM dbo.PubAdvTransData AS pat INNER JOIN
When using this SQL query: Select * from table_name what happens if the name
I have this query that inserts rows, using a subquery like so: INSERT INTO
I have a query that looks something like this: select xmlelement(rootNode, (case when XH.ID
why SqlLite query in android produce Nullpointer exception I am using this code public
How can I do this query with NHibernate select top 10 count(distinct classedition.createdby_id) as
With the help of this community, I was able to produce a query using
Sample data: I can flatten out parent-child relationship using this query.... Any help... Thanks
Currently, I am using this query, which does a pretty good job of finding
I am trying to return voice messages from a database using this query :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.