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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:24:21+00:00 2026-06-18T10:24:21+00:00

I need to query in MS Access the difference in value of a column

  • 0

I need to query in MS Access the difference in value of a column to 8 and only if it is greater than 8.

So if I have a column of numbers 1-10, I want to query the sum of all the value’s differences from 8. So the result of the query for the below column would be 3. (9-8)+(10-8)

    SELECT Sum(([time1]-8)+([time2]-8)+([time3]-8)+([time4]-8)+([time5]-8)+([time6]-8)+([time7]-8)+([time8]-8)+([time9]-8)+([time10]-8)+([time11]-8)+([time12]-8)+([time13]-8)+([time14]-8)+([time15]-8)+([time16]-8)+([time17]-8)+([time18]-8)+([time19]-8)+([time20]-8)+([time21]-8)+([time22]-8)) AS Total
FROM tblTimeTracking
WHERE (((Month(([Day])))=Month(Now()))) AND ([time1]>8 AND[time2]>8 AND[time3]>8 AND[time4]>8 AND[time5]>8 AND[time6]>8 AND[time7]>8 AND[time8]>8 AND[time9]>8 AND[time10]>8 AND[time11]>8 AND[time12]>8 AND[time13]>8 AND[time14]>8 AND[time15]>8 AND[time16]>8 AND[time17]>8 AND[time18]>8 AND[time19]>8 AND[time20]>8 AND[time21]>8 AND[time22])  ;   

Thanks,

  • 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-18T10:24:22+00:00Added an answer on June 18, 2026 at 10:24 am

    How about:

    SELECT Sum([Value]-8) As SumOfVal
    FROM table
    WHERE [Value]>8
    

    Edit re complete change in original question.

    It is not clear what you want

     SELECT Sum(([time1]-8)+([time2]-8) ...
     WHERE [time1]>8 And Time2>8 ...
    

    Time1>8 will exclude nulls, but if that is not what you are doing, you will need to consider:

     Nz([time1],0) + ...
    

    Edit re comments

    Something like:

     SELECT Sum(times) FROM
     (SELECT IIf(Time1>8,Time1-8,Time1) As times FROM Table
     UNION ALL
     SELECT IIf(Time2>8,Time2-8,Time2)  As times FROM Table) As b
    

    As b is an alias: Access SQL

    UNION / UNION ALL: View a unified result from multiple queries with a union query

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

Sidebar

Related Questions

I have a query being created using OLEDB from access and need to get
I have a couple of scenarios: Need to read the value of a column
Need to query my SQL server from Access using an ADO connection (for example),
I need a query which can do the following operation. I have a table
So I have an awful query that current exists in MS Access that I
I need help in creating an query interface with access database. In brief, with
I have an access 2010 application with a SQL Server database. But I need
Long time listener, first time caller... In Access 2007 I have a column named
Good day, I need some help with MS Access and a query. My SQL
I have a query in my Access database and a table with absolutely the

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.