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 933869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:54:09+00:00 2026-05-15T20:54:09+00:00

Hi my code doesn’t work, Im trying to group my blogentries by year and

  • 0

Hi my code doesn’t work, Im trying to group my blogentries by year and month here’s my sql

SELECT * FROM(
    SELECT WP_BlogEntries.BlogEntryID, WP_BlogEntries.AddedDate,
        WP_BlogEntries.AddedBy, WP_BlogEntries.BlogID, 
        WP_BlogEntries.Title, WP_BlogEntries.Description, WP_BlogEntries.Body,
        WP_BlogEntries.ReleaseDate, WP_BlogEntries.ExpireDate,
        WP_BlogEntries.Approved, WP_BlogEntries.Listed,
        WP_BlogEntries.CommentsEnabled, WP_BlogEntries.OnlyForMembers,
        WP_BlogEntries.ViewCount, WP_BlogEntries.Votes, 
        WP_BlogEntries.TotalRating
    FROM WP_BlogEntries
    WHERE WP_BlogEntries.ReleaseDate < GETDATE()
        AND WP_BlogEntries.ExpireDate > GETDATE()
        AND Approved = 1
        AND Listed = 1
        AND WP_BlogEntries.BlogID = @BlogID) MonthEntries 
    GROUP BY YEAR(ReleaseDate), MONTH(ReleaseDate)
  • 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-05-15T20:54:09+00:00Added an answer on May 15, 2026 at 8:54 pm

    It would be helpful to know the error message.

    You can’t do a SELECT * FROM if you specify GROUP BY.

    The only valid columns are those in the GROUP BY or an aggregate function.

    If you group by year and month, then each row will contain one year and month, it is impossible for SQL to know which other columns to display as there could be more than one. (e.g. two blog entries in one month)

    Did you mean to ORDER BY instead?

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

Sidebar

Related Questions

This code doesn't work: return this.Context.StockTakeFacts.Select(stf => ((stf.StockTakeId == stocktakeid) && (stf.FactKindId == ((int)kind)))).ToList<IStockTakeFact>();
Here is the relevant code (doesn't work): <html> <head> <title>testing td checkboxes</title> <style type=text/css>
The jquery load in the below code doesn't work. What I'm missing here? <html>
This code doesn't work. It says, no contact function. SELECT contact(member.Sname, member.Ssurname) as tee
This code doesn't work > <b>Fatal error</b>: Cannot use [] for reading i <select
The following code doesn't work, but it best show what I'm trying to achieve
This code doesn't work on mysql: update member set member.xy = memba.surba from memba
Trying the following code doesn't seem to work out for me quite as planned:
This code doesn't work propely: I call a function passing a variable What's the
following code doesn't work with input: 2 7 add Elly 0888424242 add Elly 0883666666

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.