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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:03:06+00:00 2026-05-16T23:03:06+00:00

EDIT: the database is Access 2007 Hi, I’m new here and I need some

  • 0

EDIT: the database is Access 2007

Hi, I’m new here and I need some help:

I have three tables:

  1. technicians (Id, tech_name, is_active)
  2. type_services (Id, serv_name, is_active)
  3. services (Id, date_time, prod_name, quantity, serv_type, tech_name, is_active)

I have to make a report that contain:

  1. Number of services per tech (SUM(quantity))
  2. Number of type of services per tech
  3. Total per each services
  4. Total of services

Example:


TECH_NAME TYPE_SERV1 TYPE_SERV2 TYPE_SERV3 TYPE_SERV4 TYPE_SERV5 TYPE_SERV6 TOTAL
NAME1 2 0 3 7 15 52 79 NAME2 0 0 1 6 18 45 70 NAME3 0 0 2 3 13 38 56 NAME4 1 1 0 3 11 21 37
TOTAL 3 1 6 19 57 156 242

All using a date interval

NOTE: In the services table I use the string name of serv_type and tech_name directly, so I don’t use the number id

This is the NEW sql, that it’s works but if it’s possible to make all this in a SQL sentence with no C# extra code, because not always there are one type services on services

SELECT
COUNT(Srvs.serv_type) AS numReg,
SUM(Srvs.quantity) AS tot,
Techs.tech_name AS tchs,
Srvs.serv_type AS srv
FROM
technicians AS Techs,
type_services AS TySrv,
services AS Srvs
WHERE
(Techs.is_active = true AND
TySrv.is_active = true AND
Srvs.is_active = true) AND
(Srvs.date_time BETWEEN #2010/06/01 00:00:00# AND #2010/08/30 23:59:59#
AND Srvs.tech_name = Techs.tech_name)
AND Srvs.serv_type = TySrv.serv_name
GROUP BY Srvs.serv_type, Techs.tech_name
ORDER BY Techs.tech_name ASC

Before this SQL I had three SQL to make this report xD, so I need that be more simple with one SQL

Thanks and I hope you know what I’m trying to say

  • 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-16T23:03:06+00:00Added an answer on May 16, 2026 at 11:03 pm

    In Access, I think you want something like this:

    TRANSFORM Sum(services.quantity) AS SumOfquantity
    SELECT services.tech_name, 
           Sum(services.quantity) AS [Total Of Quantity], 
           Count(services.serv_type) AS [Count of Services]
    FROM (services 
    INNER JOIN technicians ON services.tech_name = technicians.tech_name) 
    INNER JOIN type_services ON services.serv_type = type_services.serv_name
    WHERE services.is_active=True 
        AND technicians.is_active=True
        AND type_services.is_active=True 
        AND services.date_time Between #6/1/2010# And #8/30/2010 23:59:59#
    GROUP BY services.tech_name
    PIVOT services.serv_type
    

    if you wish to vary the dates, you can use a parameter.

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

Sidebar

Related Questions

I need a simple app to edit database tables. Are there any code generators
I have several objects in the database. Url to edit an object using the
EDIT What small things which are too easy to overlook do I need to
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT: This question is more about language engineering than C++ itself. I used C++
Edit : Solved, there was a trigger with a loop on the table (read
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know

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.