Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-07-2019, 11:41 AM   #1
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
iff in query

Hello friends
I have four fields in this query. I want to count in fields five that have numbers. Thanks for helping me.
Attached Images
File Type: png q.png (25.5 KB, 10 views)

kolait is offline   Reply With Quote
Old 11-07-2019, 11:47 AM   #2
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,722
Thanks: 57
Thanked 1,260 Times in 1,241 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: iff in query

Is that a Crosstab query? If so, add a Sum() column.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-07-2019, 11:52 AM   #3
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
Re: iff in query

Quote:
Originally Posted by theDBguy View Post
Is that a Crosstab query? If so, add a Sum() column.
Hello.
No I got a regular query table

kolait is offline   Reply With Quote
Old 11-07-2019, 11:54 AM   #4
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,722
Thanks: 57
Thanked 1,260 Times in 1,241 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: iff in query

Quote:
Originally Posted by kolait View Post
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.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-07-2019, 12:01 PM   #5
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
Re: iff in query

Quote:
Originally Posted by theDBguy View Post
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.
kolait is offline   Reply With Quote
Old 11-07-2019, 12:06 PM   #6
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,722
Thanks: 57
Thanked 1,260 Times in 1,241 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: iff in query

Quote:
Originally Posted by kolait View Post
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
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-07-2019, 12:18 PM   #7
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
Re: iff in query

Quote:
Originally Posted by theDBguy View Post
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?
Attached Images
File Type: png table.png (8.5 KB, 9 views)

kolait is offline   Reply With Quote
Old 11-07-2019, 12:22 PM   #8
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,722
Thanks: 57
Thanked 1,260 Times in 1,241 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: iff in query

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.
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-07-2019, 12:26 PM   #9
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
Re: iff in query

Quote:
Originally Posted by theDBguy View Post
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.
kolait is offline   Reply With Quote
Old 11-07-2019, 12:31 PM   #10
theDBguy
I知 here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 5,722
Thanks: 57
Thanked 1,260 Times in 1,241 Posts
theDBguy has a spectacular aura about theDBguy has a spectacular aura about
Re: iff in query

Hi. If this is for a student grade tracking database, you might need tables like:


tblStudents
tblLessons
tblStudentLessons
tblStudentGrades
and maybe more...
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is online now   Reply With Quote
Old 11-08-2019, 12:35 AM   #11
kolait
Newly Registered User
 
Join Date: Oct 2019
Posts: 38
Thanks: 8
Thanked 0 Times in 0 Posts
kolait is on a distinguished road
Re: iff in query

Quote:
Originally Posted by theDBguy View Post
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.
Attached Images
File Type: png sum1.png (33.3 KB, 8 views)

kolait is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump




All times are GMT -8. The time now is 08:06 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World