E
Erin Searfoss
Hi All,
I have a query [qryDailyBud] which returns each region's name and daily
budget based on the number of working days provided by a subquery
[qryWorkDaysCount]. The subquery requires 2 parameters [BegDate] and
[EndDate]. While qryWorkDaysCount is used for many purposes, when running it
through qryDailyBud these parameters are always "1/1/2007" and "12/31/2007"
so I don't want qryDailyBud to prompt the user for these but would rather
hard code it into the query. What is the syntax for this.
Eventually I would like to enable the user (or another query, form, or
report) to provide a year and use the beginning and end dates or that year as
these two parameters.
Any guidance would be appreciated. Thanks.
Erin
qryDailyBud:
SELECT [qryWorkDaysCount].Region, 10000/[qryWorkDaysCount.WorkDays] AS
FTDailyBud
FROM qryWorkDaysCount;
qryWorkDaysCount:
SELECT tblCalendar.Region, Count(*) AS WorkDays
FROM tblCalendar
WHERE (((tblCalendar.WorkingDay)='Y') AND ((tblCalendar.CalDate) Between
[BegDate] And [EndDate]))
GROUP BY tblCalendar.Region;
I have a query [qryDailyBud] which returns each region's name and daily
budget based on the number of working days provided by a subquery
[qryWorkDaysCount]. The subquery requires 2 parameters [BegDate] and
[EndDate]. While qryWorkDaysCount is used for many purposes, when running it
through qryDailyBud these parameters are always "1/1/2007" and "12/31/2007"
so I don't want qryDailyBud to prompt the user for these but would rather
hard code it into the query. What is the syntax for this.
Eventually I would like to enable the user (or another query, form, or
report) to provide a year and use the beginning and end dates or that year as
these two parameters.
Any guidance would be appreciated. Thanks.
Erin
qryDailyBud:
SELECT [qryWorkDaysCount].Region, 10000/[qryWorkDaysCount.WorkDays] AS
FTDailyBud
FROM qryWorkDaysCount;
qryWorkDaysCount:
SELECT tblCalendar.Region, Count(*) AS WorkDays
FROM tblCalendar
WHERE (((tblCalendar.WorkingDay)='Y') AND ((tblCalendar.CalDate) Between
[BegDate] And [EndDate]))
GROUP BY tblCalendar.Region;