Jump to content

Calc combined list of two fields


This topic is 2772 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi,

 

I am trying to pull data from a portal, for example I have Standard and Type fields.

I would like to pull that portal information into a text field that would show:

STANDARDFIELD & ": " & TYPEFIELD

STANDARDFIELD & ": " & TYPEFIELD

STANDARDFIELD & ": " & TYPEFIELD

ASTM: 12345

ASTM: 34556

ASTM: 85858

or

ASTM: 12345, ASTM: 34556, ASTM: 85858

 

Any help would be greatttt! Thanks

 

 

 

Link to comment
Share on other sites

Quote

or

ASTM: 12345, ASTM: 34556, ASTM: 85858

The simplest way would probably be to define a calculation field in the child table =

STANDARDFIELD & ": " & TYPEFIELD 

and another calculation field in the parent table =

Substitute ( List ( Child::cCalcField ; ¶ ; ", " )

Result type should be Text in both.

 

Another option is to use the ExecuteSQL() function to get the two fields, then use Substitute to replace both the field and the record separators.

 

Or use a recursive custom function such as: http://www.briandunning.com/cf/309

 

Edited by comment
Link to comment
Share on other sites

I have a similar calc that pulls data from 2 tables, but in this situation its both from the same table. I tried just changing the values, but I am pretty noob on SQL.

 

ExecuteSQL ( "   SELECT \"Standard\", M.\"Type\"   FROM Standards C   JOIN \"Standards\" M ON     M.\"__StandardID\" = C.\"__ComplianceID\"   WHERE \"_fkParentID\" = ?   ORDER BY \"Value\" DESC   " ; "% " ; ", " ; __ChassisID )

Link to comment
Share on other sites

I am at a disadvantage here, because (a) I don't know your field and table names, and (b) I have no way to test this. See if you can use this as your starting point:

ExecuteSQL( "SELECT Standard, Type FROM Standards WHERE fkParentID = ?" ; "-"; "," ; pkParentID )

 

Link to comment
Share on other sites

See if this works for you (untested):

ExecuteSQL ( "SELECT Standard, Type ¶
FROM Certifications INNER JOIN Standards  ¶ 
ON Certifications.\"_fkStandardsID\" = Standards.\"__StandardsID\" ¶
WHERE Certifications.\"_fkParentID\" = ?";
 "-"; "," ; 
__ParentID )

 

Edited by comment
Link to comment
Share on other sites

This topic is 2772 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.