Jump to content
  • 0

How to count something per specific criteria?


Aleksandra
 Share

Question

Hello everyone,

I hope someone can help me with this one. What would be the best way to calculate a value based on specific criteria? I have a Department table and Resources table. I need to calculate number of employees in each department. I am using calculated value in Submission form, but I am not sure how to format the formula.

Many thanks,

Aleksandra

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Hi @Aleksandra,

 

You can use the COUNT function to grab the number for each table, like so:

SELECT COUNT(Field) FROM TableName

 

You'd simply have to change the TableName to your corresponding tables. If you're trying to get those numbers separately, you would have to separate them with two calculated values.

Link to comment
Share on other sites

  • 0

Hi @Aleksandra,

 

You're missing the SELECT at the beginning. Can you try adding that and see if thatll work? Also, it should be:

SELECT COUNT(Department) FROM Am_tbl_Resources_1

You don't need to wrap them in brackets. It's pretty much doing a SELECT query in SQL. You can read more about it here: https://www.w3schools.com/sql/sql_count_avg_sum.asp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...