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  

Query in a query



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2004, 04:16 PM
PPerry
external usenet poster
 
Posts: n/a
Default Query in a query

I have a query (thanks to this group) which returns the very last date in a sequence. This query works great. I now want to use it in another query where I take the last date in the sequence (the last time a child received a new karate belt) to NOW and count the number of attendances.
I have a table with attendance information:
Student Name
Month
Number of attendances for the month
and
I have the query which returns the last belt date
My question: How would I write a query which shows the attendance of the student since the last belt promotion? Would I add a colum to the original query or create a whole new query? Thank you VERY much for your help.
  #2  
Old June 2nd, 2004, 05:53 PM
Michel Walsh
external usenet poster
 
Posts: n/a
Default Query in a query

Hi,


Bring the original table and the queries, link then through the StudentID.

Click on the summation button, on the toolbar, to get the extra line, total,
in the grid.


In the grid, drop the field original_table.DateOfAttendance , change the
GROUP BY to WHERE, and add the criteria: = queryname.LatestDate.

Bring one of the field StudentID, keep the GROUP BY.
Bring it again, this time, change the GROUP BY to COUNT.

That's all.


The COUNT occur within each group, AFTER the WHERE clause has been
considered, so, it should do what you search to get.



Hoping it may help,
Vanderghast, Access MVP




"PPerry" wrote in message
news
I have a query (thanks to this group) which returns the very last date in
a sequence. This query works great. I now want to use it in another query
where I take the last date in the sequence (the last time a child received a
new karate belt) to NOW and count the number of attendances.
I have a table with attendance information:
Student Name
Month
Number of attendances for the month
and
I have the query which returns the last belt date
My question: How would I write a query which shows the attendance of the

student since the last belt promotion? Would I add a colum to the original
query or create a whole new query? Thank you VERY much for your help.


 




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:31 AM.


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