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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:54:09+00:00 2026-06-06T17:54:09+00:00

I want to group every date that it is in the database and get

  • 0

I want to group every date that it is in the database and get the highest amount to display it on the website. I have tried to use this SQL; SELECT COUNT(date_visited) FROM visitors GROUP BY date_visited but it only shows 1.

The database looks like this:

CREATE TABLE IF NOT EXISTS `visitors` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `ipaddress` text NOT NULL,
  `page` text NOT NULL,
  `page_get` text NOT NULL,
  `date_visited` datetime NOT NULL,
  `date_lastactive` datetime NOT NULL,
  `date_revisited` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`)
)

How can I solve this problem?

Thanks in advance.

  • 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-06T17:54:11+00:00Added an answer on June 6, 2026 at 5:54 pm

    Andomar’s answer is right that you are grouping by the datetime instead of just the date.

    In addition, it seems you are trying to find the date that occurs most often in your table. To do this you can try the following:

    SELECT DATE(date_visited)
    FROM visitors
    GROUP BY DATE(date_visited)
    ORDER BY COUNT(*) DESC
    LIMIT 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this scenario. I want group on Country and Category. A store can
I want to use a for loop to print every date between 2 dates.
I want to group the common methods in one file and use it. For
I want to group RadioButtons, but I don't want to use the visible control
I have one folder with about 1000 files and I want to group them
I have a table of data for a particular stock that contains every single
I have a table that I am entering data into every day. But I
I have an AcctMgr_Flag that designates a person as the account manager. This is
I have a query of this form: SELECT e.date, SUM(e.size) as bytes FROM entries
I want to group by every minute between date1 and date2 in the following

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.