Hello, I seem to be a little stuck on how to go about doing this. I have a report with four subforms, created from two tables, with separate headers.
My hope is to:
- count all the records that will show up on the report.
- make an if statement that will make a page break visible if the record count
is greater than 42.
The records come from two tables, "Weekly_Challenges" and "Weekly_StartTime_Challenges". Since the reports are daily, I am focusing on a day at a time. So the records being counted are any records that have a value in the Weekly_StartTime_Challenges "Monday" field (Is Not Null), and the Weekly_Challenges "Monday" field that is equal to "X". Also, the UserID is equal to 4 and the WeekNumber is equal to 1 in both tables. I know, can I get anymore confusing. Sorry. This is the SQL that my query produced, but it seems to be counting all the ID's, all the WeekNumbers, all the values in both tables each separately and adding them together. I am getting this huge number "483", when I should be getting something like "46". Please any help would be appreciated.
SELECT Count(*) AS WCMonTot
FROM Weekly_Challenges, Weekly_StartTime_Challenges
WHERE ((([Weekly_Challenges]![UserID])=4) AND
(([Weekly_Challenges]![WeekNumber])=1) AND (([Weekly_Challenges]!
[Monday])="X") AND ((Weekly_StartTime_Challenges.UserID)=4) AND
((Weekly_StartTime_Challenges.WeekNumber)=1) AND
((Weekly_StartTime_Challenges.Monday) Is Not Null));
My hope is to:
- count all the records that will show up on the report.
- make an if statement that will make a page break visible if the record count
is greater than 42.
The records come from two tables, "Weekly_Challenges" and "Weekly_StartTime_Challenges". Since the reports are daily, I am focusing on a day at a time. So the records being counted are any records that have a value in the Weekly_StartTime_Challenges "Monday" field (Is Not Null), and the Weekly_Challenges "Monday" field that is equal to "X". Also, the UserID is equal to 4 and the WeekNumber is equal to 1 in both tables. I know, can I get anymore confusing. Sorry. This is the SQL that my query produced, but it seems to be counting all the ID's, all the WeekNumbers, all the values in both tables each separately and adding them together. I am getting this huge number "483", when I should be getting something like "46". Please any help would be appreciated.
SELECT Count(*) AS WCMonTot
FROM Weekly_Challenges, Weekly_StartTime_Challenges
WHERE ((([Weekly_Challenges]![UserID])=4) AND
(([Weekly_Challenges]![WeekNumber])=1) AND (([Weekly_Challenges]!
[Monday])="X") AND ((Weekly_StartTime_Challenges.UserID)=4) AND
((Weekly_StartTime_Challenges.WeekNumber)=1) AND
((Weekly_StartTime_Challenges.Monday) Is Not Null));