Forum Discussion

scottfvt's avatar
scottfvt
New Contributor
13 years ago

Choice List (Based on SQL) in Requirements from Contacts

I would like to have a Custom Field in my Requirements record with the Field Type "Choice List (Based on SQL)"  The choice list would be formed from Contact Management.  From the Data Dictionary documentation, I am looking at two fields: CompanyName and the Custom1 field.



In Contacts, I have a created a Custom Field which I named "Company Number."  I'm assuming this is Custom1 in the database.  It is a text field.



For my Custom Field in the Requirements record, I would like a concatenation of the Company Number (Custom1) and CompanyName to something that looks like "CoNum-CoName."  What would be the SQL I need to put in to do this?

1 Reply


  • I think the SQL you would need is:



    SELECT DISTINCT Custom1 + '-' + CompanyName as CompanyNumber

    FROM Contacts

    WHERE ProjId = &ProjId

    ORDER BY 1



    The ProjId = &ProjId would limit it to the contacts in the current project.

    The ORDER BY 1 will sort it by the Custom1 concatinated with the CompanyName.



    Hope that helps.