Database join element concat not showing calc value

nrsmoll

Member
Hi,

I have a database join element that links Table A to Table B. I have it set as a dropdown menu, with concat label.
Issue is a normal field element and pain_code is the calc element for the diagnosis code. The pain_code calculates appropriately in the list and form.
It does the same thing when I have put the actual table name in there. And it throws an error when I put single quotes around the placeholder (' ').
The issue element or ({thistable}.issue, ', ') part of the concat label seems to display well, its the calc element that seems not to display. (I'e tried turning on AJAX and calc on load, then loaded the record a few times)

This is my concat label code (shows issue, not pain_code):
{thistable}.issue, ', ', {thistable}.pain_code

This throws a 500 error:.
`{thistable}.issue, ', ', {thistable}.pain_code`


Any ideas on how to get the calc element to show in the db join element?
 
{thistable}.issue, ', ', {thistable}.pain_code
This is the correct syntax. But concat is fetching the columns from the database. A calc element is only storing the calculated value in the database if the record is saved.
With the standard setting "calc on save only =NO" in list/form/details view the calculation is run "on the fly", not showing the value from the DB.
 
And just to answer the second part, your name quoting was wrong, it would need to be ...

Code:
`{thistable}`.`issue`, ', ', `{thistable}`.`pain_code`

... as you have to quote both the table and field name parts in MySQL. But you only need to worry about that if the name is a reserved word in MySQL (like `where`, or `select`).

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top