iff in query (1 Viewer)

kolait

Registered User.
Local time
Tomorrow, 03:53
Joined
Oct 11, 2019
Messages
60
Hello friends
I have four fields in this query. I want to count in fields five that have numbers. Thanks for helping me.
 

Attachments

  • q.png
    q.png
    25.5 KB · Views: 84

theDBguy

I’m here to help
Staff member
Local time
Today, 16:23
Joined
Oct 29, 2018
Messages
21,358
Is that a Crosstab query? If so, add a Sum() column.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:23
Joined
Oct 29, 2018
Messages
21,358
Hello.
No I got a regular query table
Sounds like you may have a bad table structure then. In that case, you may have to manually do it. For example:


Total: Field1 + Field2 + Field3 + Field4, etc.
 

kolait

Registered User.
Local time
Tomorrow, 03:53
Joined
Oct 11, 2019
Messages
60
Sounds like you may have a bad table structure then. In that case, you may have to manually do it. For example:


Total: Field1 + Field2 + Field3 + Field4, etc.


223/5000
I want to give the students a score.
Up to four points in one day.
I made a table containing five fields:
Student Code
Date of Registration
Score one
Score two
Score three
Score four
I want to get an average for every student
But the average scores have numbers.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:23
Joined
Oct 29, 2018
Messages
21,358
223/5000
I want to give the students a score.
Up to four points in one day.
I made a table containing five fields:
Student Code
Date of Registration
Score one
Score two
Score three
Score four
I want to get an average for every student
But the average scores have numbers.
Yeah, definitely not a recommended table structure. A proper design would probably be more like:


tblStudents
StudentCode, PK
RegistrationDate


tblScores
ScoreID, PK
StudentCode, FK
Score
 

kolait

Registered User.
Local time
Tomorrow, 03:53
Joined
Oct 11, 2019
Messages
60
Yeah, definitely not a recommended table structure. A proper design would probably be more like:


tblStudents
StudentCode, PK
RegistrationDate


tblScores
ScoreID, PK
StudentCode, FK
Score
thank you.
Is that right?
 

Attachments

  • table.png
    table.png
    8.5 KB · Views: 74

theDBguy

I’m here to help
Staff member
Local time
Today, 16:23
Joined
Oct 29, 2018
Messages
21,358
Looks right. If you need to identify each score, then you need to add one more field to help you do that. For example, maybe a DateGiven or DateEarned or SubjectID, etc.
 

kolait

Registered User.
Local time
Tomorrow, 03:53
Joined
Oct 11, 2019
Messages
60
Looks right. If you need to identify each score, then you need to add one more field to help you do that. For example, maybe a DateGiven or DateEarned or SubjectID, etc.

Yes
I also need lesson specifications and tutorials ..
I do and ask.
Thank you for taking the time for me.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:23
Joined
Oct 29, 2018
Messages
21,358
Hi. If this is for a student grade tracking database, you might need tables like:


tblStudents
tblLessons
tblStudentLessons
tblStudentGrades
and maybe more...
 

kolait

Registered User.
Local time
Tomorrow, 03:53
Joined
Oct 11, 2019
Messages
60
Hi. If this is for a student grade tracking database, you might need tables like:


tblStudents
tblLessons
tblStudentLessons
tblStudentGrades
and maybe more...

Hello
In a table, I have four field scores. I want to find them in a mean field.
Calculate the mean if they have scores. For example, if two fields are scores, divide the sum by two.
If three of the four fields are scored, the average of the three scores is calculated.
Thanks for helping me.
 

Attachments

  • sum1.png
    sum1.png
    33.3 KB · Views: 66

Users who are viewing this thread

Top Bottom