Jump to content
  • 0

Calculated Field Help


pmcfarlain

Question

I have a calculated field in my datapage to find the biggest "Clean_Serial_Number" under a particular Job_ID. There are many serial numbers under each job so I want it to find the max serial number under JUST that job. Right now, this field is just displaying the max "Clean_Serial_Number" from all the data, not just from the Job_ID.

SELECT MAX(Clean_Serial_Number) FROM tbl_ggl_job_lines
WHERE Job_ID = [@field:Job_ID]

What am I doing wrong?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
14 minutes ago, pmcfarlain said:

I have a calculated field in my datapage to find the biggest "Clean_Serial_Number" under a particular Job_ID. There are many serial numbers under each job so I want it to find the max serial number under JUST that job. Right now, this field is just displaying the max "Clean_Serial_Number" from all the data, not just from the Job_ID.

SELECT MAX(Clean_Serial_Number) FROM tbl_ggl_job_lines
WHERE Job_ID = [@field:Job_ID]

What am I doing wrong?

What DataPage is this? try using 

WHERE Job_ID = target.[@field:Job_ID]

 

Link to comment
Share on other sites

  • 1
47 minutes ago, pmcfarlain said:

Same result from this:

SELECT MAX(Clean_Serial_Number) FROM tbl_ggl_job_lines
WHERE Job_ID = tbl_ggl_job_lines.[@field:Job_ID]

This is a submission form datapage. The job ID passes as a parameter from a previous page. Job ID is displayed as a non-editable field. This calculated value is just meant to show the person submitting the form what the max serial number is so they can use the next one (if the max is 1, the user should input 2 into the Serial Number submission field).

ah no, have you tried target? just 'target', like the one I've sent, not the table name.

Link to comment
Share on other sites

  • 0

Same result from this:

SELECT MAX(Clean_Serial_Number) FROM tbl_ggl_job_lines
WHERE Job_ID = tbl_ggl_job_lines.[@field:Job_ID]

This is a submission form datapage. The job ID passes as a parameter from a previous page. Job ID is displayed as a non-editable field. This calculated value is just meant to show the person submitting the form what the max serial number is so they can use the next one (if the max is 1, the user should input 2 into the Serial Number submission field).

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...
×
×
  • Create New...