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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:19:34+00:00 2026-05-15T15:19:34+00:00

here’s the query: SELECT [Lab Occurrence Form].[1 0 Preanalytical (Before Testing)],Count([Lab Occurrence Form].[1 0

  • 0

here’s the query:

SELECT [Lab Occurrence Form].[1 0 Preanalytical (Before Testing)],Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]) AS [CountOf1 0 Preanalytical (Before Testing)]
FROM [Lab Occurrence Form]
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between [Forms]![Meeting_Reasons_Frequency]![Text4] And [Forms]![Meeting_Reasons_Frequency]![Text2]))
GROUP BY [Lab Occurrence Form].[1 0 Preanalytical (Before Testing)]
HAVING Count([Lab Occurrence Form].[1 0 Preanalytical (Before Testing)])<>0

UNION SELECT [Lab Occurrence Form].[2 0 Analytical (Testing Phase)], Count([Lab Occurrence Form].[2 0 Analytical (Testing Phase)]) AS [CountOf2 0 Analytical (Testing Phase)]
FROM [Lab Occurrence Form]
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between [Forms]![Meeting_Reasons_Frequency]![Text4] And [Forms]![Meeting_Reasons_Frequency]![Text2]))
GROUP BY [Lab Occurrence Form].[2 0 Analytical (Testing Phase)]
HAVING Count([Lab Occurrence Form].[2 0 Analytical (Testing Phase)])<>0

union

SELECT  [Lab Occurrence Form].[3 0 Postanalytical ( After Testing)], Count([Lab Occurrence Form].[3 0 Postanalytical ( After Testing)]) AS [CountOf3 0 Postanalytical ( After Testing)]
FROM [Lab Occurrence Form]
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between [Forms]![Meeting_Reasons_Frequency]![Text4] And [Forms]![Meeting_Reasons_Frequency]![Text2]))
GROUP BY  [Lab Occurrence Form].[3 0 Postanalytical ( After Testing)]
HAVING Count([Lab Occurrence Form].[3 0 Postanalytical ( After Testing)])<>0

UNION SELECT [Lab Occurrence Form].[4 0 Other], Count([Lab Occurrence Form].[4 0 Other]) AS [CountOf4 0 Other]
FROM [Lab Occurrence Form]
WHERE ((([Lab Occurrence Form].[Occurrence Date]) Between [Forms]![Meeting_Reasons_Frequency]![Text4] And [Forms]![Meeting_Reasons_Frequency]![Text2]))
GROUP BY [Lab Occurrence Form].[4 0 Other]
HAVING Count([Lab Occurrence Form].[4 0 Other])<>0
ORDER BY 1, 2;

it generates something that looks like this:

1 0 Preanalytical (Before Testing)  CountOf1 0 Preanalytical (Before Testing)
1.11 Other-reject per practice  1
1.11 Other-req form marked Validity Only    1
1.11 Other-req form only, no specimen   3
1.11 Other-spec sent by mistake 1
1.11 Other-Test Req marked validity only    1
1.11 Other-validity only    3
1.11 Other-validity only-TP updated 1
1.3 QNS-Quantity Not Sufficient 103
1.4 Tests Missed/ Wrong Test Ordered    1
1.4 Tests Missed/ Wrong Test Ordered & 1.11 Other-data entry-dup tests  2
1.4 Tests Missed/Wrong Test Ordered 3
1.5 Patient Info. entered Incorrectly   1
1.6 Test Requisition Missing    22
1.6 Test Requisition Missing & 1.7 Specimen Lost    2
1.6 Test Requisition Missing-CSRM   1
1.8 Specimen not handled/processed correctly & 1.10 Operator Error(?)   1
1.8 Specimen not handled/processed correctly,1.10 Operator Error & 1.11 Other-no THC INSD recovery  1
1.9 QNS- Specimen Spilled in transit    88
2.1 Delay in Testing/resulting  1
2.1 Delay in Testing/resulting & 2.22 Instrument Problem    4

i want to group and sum the result by number

instead of having a bunch of 1.11 Others, i want to sum them up and get:

1.11 11
1.3 103
1.4 4

so i guess what i need to do is select the first 4 characters of the first column , and group it by the first column, and do a sum on the second column? please help me with this select statement

  • 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-15T15:19:35+00:00Added an answer on May 15, 2026 at 3:19 pm

    Use Val()

    ?val("1.11 Other-validity only-TP updated")
    
     1.11 
    

    Also works in queries.

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

Sidebar

Ask A Question

Stats

  • Questions 458k
  • Answers 458k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to open your routes file and add a… May 15, 2026 at 11:04 pm
  • Editorial Team
    Editorial Team added an answer Have you ever tried to use reflection? Here's a sample… May 15, 2026 at 11:04 pm
  • Editorial Team
    Editorial Team added an answer A couple things come to mind. First, your label has… May 15, 2026 at 11:04 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.