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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:33:22+00:00 2026-06-16T00:33:22+00:00

I have strings like FVS101209GO5 Stored in a MS Access data table, I want

  • 0

I have strings like FVS101209GO5 Stored in a MS Access data table, I want to count the number of strings in a certain year, so in the example that would be the year 2010

I was doing

query = "SELECT SUM( IIF( Mid( KEYLastName, 4, 2) , 1,0)) AS occur FROM MyTable WHERE Year(mydate)=2010 ;"

The length of the string is 12 or 13, for the examples @JW added

qwe123456XXX       -  2012
asd345678XXX       -  2034  
FVS101209GO5       -  2010
  • 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-16T00:33:22+00:00Added an answer on June 16, 2026 at 12:33 am

    If you wish to find the count of occurrences of various years within a string, you might like to use:

    SELECT Mid([KEYLastName],4,2) AS [Year], 
           Count(KEYLastName) AS CountOfOccurances
    FROM MyTable
    GROUP BY Mid([KEYLastName],4,2)
    

    This will return all the two digit years at (4,2) and the number of times they each occur.

    Edit re Comments

    SELECT KEYLastName, 
           Mid([KEYLastName],4,2) AS [Year], 
           DCount("*","MyTable","Mid([KEYLastName],4,2)=" 
              & Mid([KEYLastName],4,2)) AS YearCount
    FROM MyTable
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have strings like 84, 03 etc. that I want to convert to Date
I have strings that look like this example: AAABBBCDEEEEBBBAA Any character is possible in
I have strings like the ones below in a SQL column. I want to
I have strings like this 10z45 9999i4a Basically int-char-int-optionalchar I want to do this
I have strings like 5d4h2s, where I want to get 5, 4, and 2
For example I have code below string txt=I have strings like West, and West;
if I have 2 strings like: a = hello b = olhel I want
I have some strings like Café that contains special characters such as é .
I have strings that look like this: 000101456890 348324000433 888000033380 They are strings that
I have strings like the following: blabla a13724bla-bla244 35% Notice that there is always

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.