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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:30:08+00:00 2026-05-16T17:30:08+00:00

I have a web task for counting some data inside DB. I must count

  • 0

I have a web task for counting some data inside DB. I must count this data daily, weekly, and monthly.

For weekly, I am still confused to decide which MySQL syntax I should use for this case.
There are two suggestions to resolve this problem: using DAY() or WEEK().

I want this syntax is not limited by a confusing thing. As should declare the first of the month and end of month or start in Sunday or Monday, etc. I want it every time cans for use (but focuses at weekly).

Which is the one that I can use? DAY() or WEEK()?

  • 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-16T17:30:09+00:00Added an answer on May 16, 2026 at 5:30 pm

    For the weekly statistics, you need to decide whether you want your weekly statistics to run from Monday to Sunday, or from Sunday to Saturday. Either can be supported.

    Ultimately, you’ll probably be grouping by both YEAR(datefield) and WEEK(datefield, 1). When it comes to sorting monthly, you’ll be grouping by YEAR(datefield) and MONTH(datefield). For the daily statistics, if the datefield is stored in a DATE type, then you can simply group by that; if you have time too, you’ll be grouping the values by YEAR(datefield) and DAYOFYEAR(datefield).

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

Sidebar

Related Questions

I have some web application for placement on external sites. This application is a
I have a web page, used for admin purposes, which runs a task (image
I have the task of choosing an XMPP server/client solution for an internal web
I have been given the task of converting a macromedia application to a web
I have a simple task. I have an existing project with a web service
I have a web app which has a single long running task - generating
I have a web service that returns a complex data structure representing the results
I have a web application that has a requirement to take data from an
I have a web site. This is a drupal site using PostgreSQL database.In this
I want to accomplish the following task. I have an web application through which

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.