Jump to content
  • 0

Calculated Field Not Working on WHERE clause


KateyN

Question

Hi! I have a details page where I am trying to list names of participants in enrolled in a group. I have the following calculated field, but instead of only showing the names associated with the Group_ID, it's listing all of the names in the table. Can anyone point me into where I am potentially going wrong here?

SELECT 
   
  Participant_Name= STUFF((SELECT DISTINCT CHAR(10) + (Participant_Name)
                 FROM FSE_Groups_Topics_Participants
                 WHERE Group_ID = [@field:Group_ID]
                 FOR XML PATH('')), 1, 1, '')

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @KateyN,

The syntax looks correct to get the names related to the specific group.

Please test the formula with the added 'target' keyword. It is not SQL specific keyword but Caspio-specific.

STUFF((SELECT DISTINCT CHAR(10) + (Participant_Name)
                 FROM FSE_Groups_Topics_Participants
                 WHERE Group_ID = target.[@field:Group_ID]
                 FOR XML PATH('')), 1, 1, '')

Also, please double-check if this field name is correct [@field:Group_ID].

If this doesn't help, please specify the 'Form element' of the Group_ID field used on the Details DataPage.

Is it editable or 'Display only'? Is it a Dropdown, etc. (if it is editable)? 

Does it receive the Group_ID value as a parameter? 

Also, instead of the Calculated field please test a Virtual field that is set as a Calculated value.

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...