L
Linda RQ
Using Access 2003
I have a report based on this query below. It shows the names and years
worked for employees for the month I type in. I would like to put a control
on the report that says "No Anniversarys this month". 2 problems. I don't
know if I would add an expression in the query then add a control bound to
that field or if there is a way to put the expression in a control on the
report to do this. I think it will be an If statement but not sure about
that either.
Here it is in LindaLanguage.
If Years Worked is Null then enter this "No Anniversaries This Month".
I can imagine a few problems with this...there would be 2 null fields, the
name and the years worked. Do I need to put both fields in the expression?
SELECT qryDepartmentEmployees.Name, qryDepartmentEmployees.dttHireDate,
DateSerial(Year(Date()),Month([dttHireDate]),Day([dtthireDate])) AS
HappyAnniversary, Format([dttHireDate],"mmmm") AS MonthName,
DateDiff("yyyy",[dttHireDate],[HappyAnniversary]) AS [Years Worked],
qryDepartmentEmployees.FandLName
FROM qryDepartmentEmployees
WHERE (((Format([dttHireDate],"mmmm"))=[Enter Month Name]));
I have a report based on this query below. It shows the names and years
worked for employees for the month I type in. I would like to put a control
on the report that says "No Anniversarys this month". 2 problems. I don't
know if I would add an expression in the query then add a control bound to
that field or if there is a way to put the expression in a control on the
report to do this. I think it will be an If statement but not sure about
that either.
Here it is in LindaLanguage.
If Years Worked is Null then enter this "No Anniversaries This Month".
I can imagine a few problems with this...there would be 2 null fields, the
name and the years worked. Do I need to put both fields in the expression?
SELECT qryDepartmentEmployees.Name, qryDepartmentEmployees.dttHireDate,
DateSerial(Year(Date()),Month([dttHireDate]),Day([dtthireDate])) AS
HappyAnniversary, Format([dttHireDate],"mmmm") AS MonthName,
DateDiff("yyyy",[dttHireDate],[HappyAnniversary]) AS [Years Worked],
qryDepartmentEmployees.FandLName
FROM qryDepartmentEmployees
WHERE (((Format([dttHireDate],"mmmm"))=[Enter Month Name]));