Hi all,
I wrote a query that counts all records where the start and enddate are between the start year and end year of a form.
There's one problem though, Access sais it is too complex to evaluate or that it has been typed wrong.
This is my query:
SELECT Count (Student.Number) AS NumberOfStudents
FROM StudentMobility INNER JOIN Contract ON StudentMobility.Studyplace = Contract.Studyplace
WHERE (((StudentMobility.PeriodStart) > "#01/01/Forms!frmContract!kzlPeriod!Column(2)#"
AND (StudentsMobility.PeriodEnd) < "#31/12/Forms!frmContract!kzlPeriod!Column(1)#"
AND (Contract.School)=[Forms]![frmContract]![kzlSchool]
AND (StudentMobility.Studyplace)=[Forms]![frmContract]![kzlStudyplace]));
I got years in kzlPeriod and try to add a date to it;
"#Date YearFromTheForm#"
Is this the past that is to complicated or should be typed different?
Anybody anny idea how to write such a query? And do Access query's support The Form!ComboBox!Column(int) thing?
I want to put it in a textfield (would it work if I selected [query].[NumberOfStudents] as source?
Thanks so much for anny help
I wrote a query that counts all records where the start and enddate are between the start year and end year of a form.
There's one problem though, Access sais it is too complex to evaluate or that it has been typed wrong.
This is my query:
SELECT Count (Student.Number) AS NumberOfStudents
FROM StudentMobility INNER JOIN Contract ON StudentMobility.Studyplace = Contract.Studyplace
WHERE (((StudentMobility.PeriodStart) > "#01/01/Forms!frmContract!kzlPeriod!Column(2)#"
AND (StudentsMobility.PeriodEnd) < "#31/12/Forms!frmContract!kzlPeriod!Column(1)#"
AND (Contract.School)=[Forms]![frmContract]![kzlSchool]
AND (StudentMobility.Studyplace)=[Forms]![frmContract]![kzlStudyplace]));
I got years in kzlPeriod and try to add a date to it;
"#Date YearFromTheForm#"
Is this the past that is to complicated or should be typed different?
Anybody anny idea how to write such a query? And do Access query's support The Form!ComboBox!Column(int) thing?
I want to put it in a textfield (would it work if I selected [query].[NumberOfStudents] as source?
Thanks so much for anny help