Query: And/Or Criteria Vs. Totals

Manny74

Board Regular
Joined
May 6, 2016
Messages
124
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello All,

So I am trying to determine how many orders my provider entered by noon, also how many discharge orders entered by noon.

It seems Access has two common criterias I can use, And is one, and Or is another.

I want a query that gives me both the numbers of orders and discharges orders entered before noon...It seems the query I created gives me one or another.

My query has <#12:00PM# for Order by Noon...but when I enter <#12:0PM# for D/C by Noon (the Or row, I only get the total for Order by Noon (see below, 21)....

Ideally I'd like to see totals for both (Order by Noon 21 and D/C by Noon 22 - see below)

When I place<#12:00PM# for Order by Noon and D/C by Noon, on the same row, I only get records that have both Order by Noon and D/C by Noon....

How can I get both totals on my query?



MDVISIT TYPEORDER BY NOOND/C BY NOON
DOE MD, JIMIP22:060:10
DOE MD, JIMIP12:362:22
DOE MD, JIMIP16:176:35
DOE MD, JIMIP11:2110:10
DOE MD, JIMIP10:5810:20
DOE MD, JIMIP6:4410:37
DOE MD, JIMIP8:2910:50
DOE MD, JIMIP8:0211:10
DOE MD, JIMIP10:0511:14
DOE MD, JIMIP8:5411:26
DOE MD, JIMIP8:2911:27
DOE MD, JIMIP6:5011:28
DOE MD, JIMIP7:1711:30
DOE MD, JIMIP9:2511:36
DOE MD, JIMIP6:4711:41
DOE MD, JIMIP10:3011:50
DOE MD, JIMIP12:2411:52
DOE MD, JIMIP10:2911:55
DOE MD, JIMIP8:2111:58
DOE MD, JIMIP10:4011:58
DOE MD, JIMIP11:2911:59
DOE MD, JIMIP12:5811:59
DOE MD, JIMIP9:2112:05
DOE MD, JIMIP10:1112:05
DOE MD, JIMIP10:1112:18
DOE MD, JIMIP9:2512:30
DOE MD, JIMIP12:2612:30
DOE MD, JIMIP14:1512:30
21
22
43
<colgroup><col width="85" style="width: 64pt; mso-width-source: userset; mso-width-alt: 3108;"> <col width="86" style="width: 65pt; mso-width-source: userset; mso-width-alt: 3145;"> <col width="127" style="width: 95pt; mso-width-source: userset; mso-width-alt: 4644;"> <col width="108" style="width: 81pt; mso-width-source: userset; mso-width-alt: 3949;"> <col width="64" style="width: 48pt;"> <tbody> </tbody>
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi as a rule in cases like this (where criteria is possibly at odds), you should write two queries for this. If you want to you can "combine" them into a single report after that.
 
Upvote 0
I agree. I would build a query to add the category I want to classify the record in (for example 'morning' for before noon) then run a second query totaling by category.
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,457
Members
448,898
Latest member
drewmorgan128

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top