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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:11:32+00:00 2026-05-12T19:11:32+00:00

I have a table full of items that each have a unique ItemID .

  • 0

I have a table full of items that each have a unique ItemID. There is another table with information on tests that are done on these items around once a month (some may have multiple tests per month and some may have none some months) and each test entry has a full date mm/dd/yyyy. I would like to display the average of one of the fields over all the data on a monthly basis. So assuming what I’m averaging is the item weight, I want to end up with a table like this:

Date AvgOfWeight  
1/09 24.55  
2/09 28.64  
3/09 22.39  

and so on…

I know that I can do a query to do averages and I can group the averages by certain criteria, but is there an easy way to group mm/dd/yyyy dates by month?

  • 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-12T19:11:32+00:00Added an answer on May 12, 2026 at 7:11 pm

    I love this strzero function that can be used here this way:

    m_monthYear = strZero(year(date()),4) & "-" & strZero(month(date()),2)
    

    Results look like 2009-09 and can be ordered ascending, as they begin with the year. You’ll just have to create this strZero function as follows:

    Public function strZero(x_myLong as long, x_length as integer) as string
    Dim m_strZero as string
    
    m_strZero = trim(str(x_myLong))
    do while len(m_strZero) <= x_length
        m_strZero = "0" & m_strZero
    loop
    strZero = m_strZero
    end function
    

    This was written on the fly. Please check all parameters (if any) for str, add error management, and adapt to your own needs. You might like to pass x_myLong as a variant, in order to return a ‘0000’ string for example. This function has multiple other uses when converting numbers to fixed length strings.

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

Sidebar

Related Questions

I have a Table full of players. Each of these players can have a
I have a table full of items and prices for said items. I would
I have a table full of items from different sources. Some of the sources
I have 10,000 items in a table that displays 20 items per page on
I have a table that contains a startdate for each item for example: ID
We have built an internal tool that generates the whole data access, each table
I have a table full of longitude/ latitude pairs in decimal format (e.g., -41.547,
I have a table full of Dealers along with their latitude and longitude. I
I have a table full of bugs. The BugTitle is the page erroring and
I have a table full of cells and i would like to get on

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.