MarkRennes
Registered User.
- Local time
- Today, 22:54
- Joined
- Feb 18, 2011
- Messages
- 13
I have used a SELECT UNION in order to get round the fact that Access truncates Memo fields.
My query reads:
SELECT DISTINCT [surname] & " " & [forenames] AS fullname, Answer.grade, Answer.[grade mark], Answer.[actual mark], Answer.[penalty type], Answer.[penalty percentage], [Project Question].[weighting in project], Project.[weighting in module], [actual mark]*[weighting in project]*[weighting in module] AS contribution, Student.[student number], [Enter Student N°; leave blank to show all] AS Expr1, Student.surname, Student.forenames, Team.[team name], Project.[project code], Project.[weighting in module], Question.[question code], [Project Question].[question number], [Project Question].[question part], [Project Question].[max mark], [Project Question].[weighting in project], Answer.[actual mark], [Project Weighting].type, [Project Weighting].[SumOfweighting in module], Project.[project type], Answer.[answer nr]
FROM [Project Weighting] INNER JOIN ((Team INNER JOIN (Question INNER JOIN (Project INNER JOIN ([Project Question] INNER JOIN Answer ON [Project Question].[project question SID] = Answer.[project question SID]) ON (Project.semester = [Project Question].semester) AND (Project.yr = [Project Question].yr) AND (Project.[project code] = [Project Question].[project code]) AND (Project.[module code] = [Project Question].[module code])) ON Question.[question code] = [Project Question].[question code]) ON (Team.trigramme = Answer.trigramme) AND (Team.semester = Answer.semester) AND (Team.yr = Answer.yr) AND (Team.[team number] = Answer.[team number]) AND (Team.[group number] = Answer.[group number]) AND (Team.[module code] = Answer.[module code])) INNER JOIN (Student INNER JOIN [Team Student] ON Student.[student number] = [Team Student].[student number]) ON (Team.trigramme = [Team Student].trigramme) AND (Team.semester = [Team Student].semester) AND (Team.yr = [Team Student].yr) AND (Team.[team number] = [Team Student].[team number]) AND (Team.[group number] = [Team Student].[group number]) AND (Team.[module code] = [Team Student].[module code])) ON [Project Weighting].type = Project.type
WHERE (((Student.[student number])=[Enter Student N°; leave blank to show all]) AND (([Enter Student N°; leave blank to show all]) Is Not Null)) OR ((([Enter Student N°; leave blank to show all]) Is Null))
ORDER BY [surname] & " " & [forenames], Project.[project code], [Project Question].[question number] UNION select news as newz, null, null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null, null, null , null from control where sid = 1;
The field newz is not visible when I use that query as the record source in a report - that is, the field list includes fullname, team number etc. but not newz (or news).
What am I doing wrong, please? Thanks for your help.
My query reads:
SELECT DISTINCT [surname] & " " & [forenames] AS fullname, Answer.grade, Answer.[grade mark], Answer.[actual mark], Answer.[penalty type], Answer.[penalty percentage], [Project Question].[weighting in project], Project.[weighting in module], [actual mark]*[weighting in project]*[weighting in module] AS contribution, Student.[student number], [Enter Student N°; leave blank to show all] AS Expr1, Student.surname, Student.forenames, Team.[team name], Project.[project code], Project.[weighting in module], Question.[question code], [Project Question].[question number], [Project Question].[question part], [Project Question].[max mark], [Project Question].[weighting in project], Answer.[actual mark], [Project Weighting].type, [Project Weighting].[SumOfweighting in module], Project.[project type], Answer.[answer nr]
FROM [Project Weighting] INNER JOIN ((Team INNER JOIN (Question INNER JOIN (Project INNER JOIN ([Project Question] INNER JOIN Answer ON [Project Question].[project question SID] = Answer.[project question SID]) ON (Project.semester = [Project Question].semester) AND (Project.yr = [Project Question].yr) AND (Project.[project code] = [Project Question].[project code]) AND (Project.[module code] = [Project Question].[module code])) ON Question.[question code] = [Project Question].[question code]) ON (Team.trigramme = Answer.trigramme) AND (Team.semester = Answer.semester) AND (Team.yr = Answer.yr) AND (Team.[team number] = Answer.[team number]) AND (Team.[group number] = Answer.[group number]) AND (Team.[module code] = Answer.[module code])) INNER JOIN (Student INNER JOIN [Team Student] ON Student.[student number] = [Team Student].[student number]) ON (Team.trigramme = [Team Student].trigramme) AND (Team.semester = [Team Student].semester) AND (Team.yr = [Team Student].yr) AND (Team.[team number] = [Team Student].[team number]) AND (Team.[group number] = [Team Student].[group number]) AND (Team.[module code] = [Team Student].[module code])) ON [Project Weighting].type = Project.type
WHERE (((Student.[student number])=[Enter Student N°; leave blank to show all]) AND (([Enter Student N°; leave blank to show all]) Is Not Null)) OR ((([Enter Student N°; leave blank to show all]) Is Null))
ORDER BY [surname] & " " & [forenames], Project.[project code], [Project Question].[question number] UNION select news as newz, null, null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null , null, null, null , null from control where sid = 1;
The field newz is not visible when I use that query as the record source in a report - that is, the field list includes fullname, team number etc. but not newz (or news).
What am I doing wrong, please? Thanks for your help.