A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Beginner Total Query Question



 
 
Thread Tools Display Modes
  #1  
Old October 4th, 2006, 05:56 PM posted to microsoft.public.access.queries
ferde
external usenet poster
 
Posts: 141
Default Beginner Total Query Question

I have a table with two fields. .... DATE and ROOM.

I would like to total the number of hospital rooms completed on each
floor on a specified date. I need to generate one query which gives the
total number of rooms completed on EACH floor on a specified date. For
example the SQL view I have included here should give me a total ,( not an
indivdual count) of 5 rooms completed on the 6 North floor for the month of
august. Any help would be greatly appreciated as I am just learning.

SELECT Count([Log table].Log) AS [6 North], [Log table].Date
FROM [Log table]
WHERE ((([Log table].Room) Between "603" And "641"))
GROUP BY [Log table].Date;

  #2  
Old October 4th, 2006, 06:17 PM posted to microsoft.public.access.queries
Roger Carlson
external usenet poster
 
Posts: 222
Default Beginner Total Query Question

You said there are two fields, but I see 3: Date, Room, and Log.

The best way to do this would be to have a "Floor" field as well. Then your
SQL would look something like this:
SELECT Count([Log table].Room) AS RoomCount, [Log table].Date, [Log
table].Floor
FROM [Log table]
GROUP BY [Log table].Date,[Log table].Floor;

I don't really see a way to do it based on your existing table. Perhaps
someone else does.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L



"ferde" wrote in message
...
I have a table with two fields. .... DATE and ROOM.

I would like to total the number of hospital rooms completed on each
floor on a specified date. I need to generate one query which gives

the
total number of rooms completed on EACH floor on a specified date. For
example the SQL view I have included here should give me a total ,( not an
indivdual count) of 5 rooms completed on the 6 North floor for the month

of
august. Any help would be greatly appreciated as I am just learning.

SELECT Count([Log table].Log) AS [6 North], [Log table].Date
FROM [Log table]
WHERE ((([Log table].Room) Between "603" And "641"))
GROUP BY [Log table].Date;



  #3  
Old October 4th, 2006, 06:41 PM posted to microsoft.public.access.queries
ferde
external usenet poster
 
Posts: 141
Default Beginner Total Query Question

Thank you for the speedy reply.

"ferde" wrote:

I have a table with two fields. .... DATE and ROOM.

I would like to total the number of hospital rooms completed on each
floor on a specified date. I need to generate one query which gives the
total number of rooms completed on EACH floor on a specified date. For
example the SQL view I have included here should give me a total ,( not an
indivdual count) of 5 rooms completed on the 6 North floor for the month of
august. Any help would be greatly appreciated as I am just learning.

SELECT Count([Log table].Log) AS [6 North], [Log table].Date
FROM [Log table]
WHERE ((([Log table].Room) Between "603" And "641"))
GROUP BY [Log table].Date;

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:21 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.