I have a query that pulls out student assessment data. It was looking at 2014/15 data but now it's come time to move on to 2015/16 data. I have two lines (by lines, I mean lines in design view, not lines of SQL code) of criteria on my query, each of which filter by academic year. After updating these, I get the "Data type mismatch in criteria expression" error.
If I change the academic year in only one of the criteria lines, it works. If I take out the only criteria that are different between the two lines entirely (so removing that element of filtration), it doesn't work. So it looks like it may be because of one criterion, but that it needs some filtration on that field to work. Confusing.
For information, the field that differs in its criteria across the two lines is "actual grade (module): smr_actg" - one excludes certain values and one includes null values (as I found that when you filter out certain values it annoyingly also filters out records with null values in that field, so you have to filter them back in :banghead
.
I've tried converting the academic year "2015/6" using Val but it gave me the same error.
Any ideas? The SQL is below (but I generally use the design view to edit, as I'm less comfortable editing the SQL directly).
If I change the academic year in only one of the criteria lines, it works. If I take out the only criteria that are different between the two lines entirely (so removing that element of filtration), it doesn't work. So it looks like it may be because of one criterion, but that it needs some filtration on that field to work. Confusing.
For information, the field that differs in its criteria across the two lines is "actual grade (module): smr_actg" - one excludes certain values and one includes null values (as I found that when you filter out certain values it annoyingly also filters out records with null values in that field, so you have to filter them back in :banghead

I've tried converting the academic year "2015/6" using Val but it gave me the same error.
Any ideas? The SQL is below (but I generally use the design view to edit, as I'm less comfortable editing the SQL directly).
Code:
SELECT DISTINCT srs_fac.fac_name AS faculty, [awd_desc] & " " & [rou_name] AS [full award title], ins_mod.mod_code AS [module code], cam_sas.spr_code AS [ID number], Left([stu_name],Len([stu_fnm1])) AS [first name], Right([stu_name],Len([stu_surn])) AS [last name], StrConv([spr_snam],3) AS [known as], [smr_actm]/100 AS [actual mark (module)], IIf(IsNull([smr_agrg]),'','Yes') AS agreed, ins_smr.smr_actg AS [actual grade (module)], srs_scj.scj_stac AS status, ins_smr.mav_occur AS occurrence, ins_spr.rou_code AS route, ins_smr.psl_code AS period, cam_sas.ayr_code, Right([cam_sas.mab_seq],1) AS component, [sas_actm]/100 AS [actual mark (component)]
FROM (((srs_scj INNER JOIN (((ins_spr INNER JOIN ((cam_ast INNER JOIN cam_mab ON cam_ast.[ast_code] = cam_mab.[ast_code]) INNER JOIN (cam_sas INNER JOIN ins_mod ON cam_sas.mod_code = ins_mod.mod_code) ON (cam_sas.mab_seq = cam_mab.mab_seq) AND (cam_mab.map_code = cam_sas.map_code)) ON ins_spr.spr_code = cam_sas.spr_code) INNER JOIN ins_rou ON ins_spr.rou_code = ins_rou.rou_code) INNER JOIN ins_awd ON ins_spr.awd_code = ins_awd.awd_code) ON srs_scj.scj_sprc = ins_spr.spr_code) INNER JOIN (srs_crs INNER JOIN srs_fac ON srs_crs.crs_facc = srs_fac.fac_code) ON srs_scj.scj_crsc = srs_crs.crs_code) INNER JOIN ins_smr ON (ins_smr.spr_code = cam_sas.spr_code) AND (cam_sas.mod_code = ins_smr.mod_code)) INNER JOIN ins_stu ON ins_spr.spr_stuc = ins_stu.stu_code
WHERE (((ins_smr.smr_actg)<>"DR" And (ins_smr.smr_actg)<>"FR" And (ins_smr.smr_actg)<>"NW" And (ins_smr.smr_actg)<>"FW") AND ((srs_scj.scj_stac)<>"T" And (srs_scj.scj_stac)<>"T1") AND ((cam_sas.ayr_code)="2015/6") AND ((ins_mod.mod_iuse)="Y") AND ((ins_smr.smr_proc)="SAS")) OR (((ins_smr.smr_actg) Is Null) AND ((srs_scj.scj_stac)<>"T" And (srs_scj.scj_stac)<>"T1") AND ((cam_sas.ayr_code)="2015/6") AND ((ins_mod.mod_iuse)="Y") AND ((ins_smr.smr_proc)="SAS"));