count record on subform

  • Thread starter imstuck via AccessMonster.com
  • Start date
I

imstuck via AccessMonster.com

i have this code on my subform's records source:

SELECT [Training Sessions].TSID, [Training Sessions].ModuleName, [Training
Sessions].SessionDate, [Training Sessions].SessionTimeFrom, [Training
Sessions].SessionTimeTo, [Training Sessions].SessionVenue, [Training Sessions]
.InstructorID, Count([Training Records].TraineeID) AS CountOfTraineeID, Abs
(Sum(NoShow)) AS CountNoShow, Instructors.LastName, Instructors.FirstName
FROM (Instructors INNER JOIN [Training Sessions] ON Instructors.InstructorID
= [Training Sessions].InstructorID) INNER JOIN [Training Records] ON
[Training Sessions].TSID = [Training Records].TSID
WHERE ((([Training Sessions].SessionDate) Between DateSerial(Year(Date()),
Month(Date()),1) And Date()))
GROUP BY [Training Sessions].TSID, [Training Sessions].ModuleName, [Training
Sessions].SessionDate, [Training Sessions].SessionTimeFrom, [Training
Sessions].SessionTimeTo, [Training Sessions].SessionVenue, [Training Sessions]
.InstructorID, Instructors.LastName, Instructors.FirstName
ORDER BY [Training Sessions].SessionDate DESC;


I want to display the total NoShow & Attendees (separately) for the current
month using a textbox and will be shown on my main form. It will be something
like a summary.

the name of my subform is: MainFormSubform

i also used this to count the records of the current month: (works fine)
=DCount("TSID","[Training Sessions]","SessionDate between
DateSerial(Year(Date()),Month(Date()),1) And
DateSerial(Year(Date()),Month(Date())+1,0)")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

count record 6
Report 3
Yes/No 7
Count YES/NO Field 2
DCOUNT 11
select record and display details on another form 2
relationship - query 2
Display highest rate of record 4

Top