Hi All
I am building a tool that will create academic reports for teachers.
The idea is that the teacher assigns a 'generic' comment to each of the grade options in their subject
The following are fake comments to illustrate the point.
Grade 'A' - Sname was an active participant in the class this term. He attended lsn lessons and scored pts points for good behaviour.
Grade 'B' - Sname sometimes took part in class activites. He attended lsn lessons and scored pts points for good behaviour.
Grade 'C' - Sname seldom participated in class activites. He attended lsn lessons and scored pts points for good behaviour.
When the teacher assigns the grade (A,B or C) to the student, their report comment is updated accordingly.
When all grades are assigned, I need to update the comments, replacing
'Sname' with the students first name (working) and
'he' with 'she' (this is working well) and
'him' with 'her' (this is working well) and
'himself' with herself' etc for the girls (Also working well)
I also replace
'lsn' with the count of lessons that the student attended (this is working well) and
and finally, I try to replace
'pts' with the number of points scored during the term (BUT THIS ONE DELETES ALL THE CONTENT OF THE FIELD IN ALL OF THE RECORD)
The only things that can think of are either
1. Something is going wrong when the score is converted from a number to string (but then why does the 'lsn' conversion work?) or
2. It has something to do with the fact that I am updating an RTF (long text) field. (So there may be underlying html tags in the field) but why would that cause me to loose all the comments)
The following are my queries.
'Change gender context from 'he' to 'she' -- This works
'update the number of lessons attended : -- This works
HOWEVER - This one deletes all the data in the field - on EVERY RECORD
SQL 2016 back-end / Access 2016 front-end.
I have checked the data types and formats of both the SCORE and LESSONCOUNT fields - They are identical. (in both SQL and Access)
I have also deleted and recreated both the table and the query, several times.
Any ideas what going on ?
I am building a tool that will create academic reports for teachers.
The idea is that the teacher assigns a 'generic' comment to each of the grade options in their subject
The following are fake comments to illustrate the point.
Grade 'A' - Sname was an active participant in the class this term. He attended lsn lessons and scored pts points for good behaviour.
Grade 'B' - Sname sometimes took part in class activites. He attended lsn lessons and scored pts points for good behaviour.
Grade 'C' - Sname seldom participated in class activites. He attended lsn lessons and scored pts points for good behaviour.
When the teacher assigns the grade (A,B or C) to the student, their report comment is updated accordingly.
When all grades are assigned, I need to update the comments, replacing
'Sname' with the students first name (working) and
'he' with 'she' (this is working well) and
'him' with 'her' (this is working well) and
'himself' with herself' etc for the girls (Also working well)
I also replace
'lsn' with the count of lessons that the student attended (this is working well) and
and finally, I try to replace
'pts' with the number of points scored during the term (BUT THIS ONE DELETES ALL THE CONTENT OF THE FIELD IN ALL OF THE RECORD)
The only things that can think of are either
1. Something is going wrong when the score is converted from a number to string (but then why does the 'lsn' conversion work?) or
2. It has something to do with the fact that I am updating an RTF (long text) field. (So there may be underlying html tags in the field) but why would that cause me to loose all the comments)
The following are my queries.
'Change gender context from 'he' to 'she' -- This works
Code:
UPDATE DBO_FLX_RPT_Results INNER JOIN dbo_STU_STUDENT ON DBO_FLX_RPT_Results.ID_Student = dbo_STU_STUDENT.ID_Student SET DBO_FLX_RPT_Results.Comment = Replace([Comment]," he "," she ")
WHERE (((DBO_FLX_RPT_Results.ID_FLX_Rpt_Subject)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![Get_Subject]) AND ((DBO_FLX_RPT_Results.TT_Yr)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindYr]) AND ((DBO_FLX_RPT_Results.TT_Term)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindTerm]) AND ((dbo_STU_STUDENT.PERS_Gender)="FEMALE"));
'update the number of lessons attended : -- This works
Code:
UPDATE DBO_FLX_RPT_Results INNER JOIN dbo_STU_STUDENT ON DBO_FLX_RPT_Results.ID_Student = dbo_STU_STUDENT.ID_Student SET DBO_FLX_RPT_Results.Comment = Replace([Comment],"lsn",Str([DBO_FLX_RPT_Results].[LessonCount]))
WHERE (((DBO_FLX_RPT_Results.ID_FLX_Rpt_Subject)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![Get_Subject]) AND ((DBO_FLX_RPT_Results.TT_Yr)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindYr]) AND ((DBO_FLX_RPT_Results.TT_Term)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindTerm]));
HOWEVER - This one deletes all the data in the field - on EVERY RECORD
Code:
UPDATE DBO_FLX_RPT_Results INNER JOIN dbo_STU_STUDENT ON DBO_FLX_RPT_Results.ID_Student = dbo_STU_STUDENT.ID_Student SET DBO_FLX_RPT_Results.Comment = Replace([Comment],"pts",Str([DBO_FLX_RPT_Results].[Score]))
WHERE (((DBO_FLX_RPT_Results.ID_FLX_Rpt_Subject)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![Subj_ID]) AND ((DBO_FLX_RPT_Results.TT_Yr)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindYr]) AND ((DBO_FLX_RPT_Results.TT_Term)=[Forms]![NAV_FLX]![NavigationSubform].[Form]![FindTerm]));
SQL 2016 back-end / Access 2016 front-end.
I have checked the data types and formats of both the SCORE and LESSONCOUNT fields - They are identical. (in both SQL and Access)
I have also deleted and recreated both the table and the query, several times.
Any ideas what going on ?