Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Framework » Screen/Report - calculated/concat fields
Screen/Report - calculated/concat fields [message #5597] Thu, 02 June 2016 11:55 Go to next message
htManager is currently offline  htManager
Messages: 375
Registered: May 2014
Senior Member
Can I display two or more field values as 'calculated' fields like this in a report (and/or in a screen):

$structure['title'][] = array('text' => 'CONCAT(vereine_kuerzel, \' - \', mannschaften_id)',
'width' => 100,
'align' => 'left',
'x' => 45);

I tried it with the SQL_FROM statement with a LEFT JOIN in the script file too but with no success.

$sql_from = 'training_plan_kopf '
. 'LEFT JOIN orga_mannschaften ON ('
. 'training_plan_kopf.vereine_kuerzel = orga_mannschaften.vereine_kuerzel AND '
. 'training_plan_kopf.mannschaften_id = orga_mannschaften.mannschaften_id) '
. 'CONCAT(vereine_kuerzel, \' - \', mannschaften_id) AS verein_id ';

The SQL statement brings up an error. You see an ending ')' behind the WHERE clause but no beginning one.

Or is there a better way?
Re: Screen/Report - calculated/concat fields [message #5598 is a reply to message #5597] Fri, 03 June 2016 04:50 Go to previous message
AJM is currently offline  AJM
Messages: 2309
Registered: April 2006
Location: Surrey, UK
Senior Member
You can certainly use a function such as CONCAT() in a SELECT statement, but in your example you have placed it after the FROM clause instead of before, which produces an invalid query.

You could always combine two or more fields into a single field within your PHP code, such as in the _cm_post_getData() method.

Previous Topic: Task ID/Script ID
Next Topic: Convert date ccyy-mm-dd to dd.mm.ccyy
Goto Forum:

Current Time: Sat Aug 13 12:04:55 EDT 2022

Total time taken to generate the page: 0.01333 seconds