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

  • Home
  • SEARCH
  • 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 7678899
In Process

The Archive Base Latest Questions

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

i have day, month, year, value columns in one table, here i need to

  • 0

i have day, month, year, value columns in one table, here i need to get every week average value in one month.
how to get that. please help me regarding this.

select avg(value) from table group by month 

gives month average.

select avg(value) from table group by day

gives day average.
but how to get week average from month field.

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

    You can’t “get weeks from a month” as one is not a subset of the other.
    The number of days (and hence weeks) in 1 month varies from month to month and only in non-leap years – and in February only – are there exactly 4 weeks in a month.

    You should use the original date field and use a date function to limit/group the data by week.
    get the week in mySQL with
    WEEK(timestamp)
    or
    YEARWEEK(timestamp)
    or
    WEEKOFYEAR(NOW())
    or
    DATE_FORMAT($yourDate, \'%X %V\') as week

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

Sidebar

Related Questions

I have a date like 27-12-2010 ( day-month-year ) .I need the following value
I have a directory full of log files in the form ${name}.log.${year}{month}${day} such that
I have the following Nant Script snippet. <zip zipfile=${devEnvironment}..\dev-${datetime::get-year(datetime::now())}${datetime::get-month(datetime::now())}${datetime::get-day(datetime::now())}.zip> <fileset basedir=${devEnvironment}> <include name=**/*/> </fileset>
I have three columns, y, m, and d (year, month, and day) and want
I have a birthdate, year, month, day columns where columns year,month,day are foreign key
I have table as P_Id | userid | year | month | day -----+--------+------+-------+------
I have the following 6 integer db columns: Year Day Month Hour Minute Second
I have an integer that will have the value of a year month and
I have table like this create table tbl_1( year int, month int, day int
I have an asp.net mvc application with a route similar to: routes.MapRoute(Blog, {controller}/{action}/{year}/{month}/{day}/{friendlyName}, new

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.