• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFSelect Problem

New Here ,
Aug 07, 2006 Aug 07, 2006

Copy link to clipboard

Copied

I am having a problem with CFSELECT (w/ in a FLASH FORM) and SELECTED.

The query that populates the drop-down select box is:

<CFQUERY NAME="GetUsers">
select last_name || ', ' || first_name as uname
from users
</CFQUERY>

Example: uname= Doe, John


The query that the form uses is:

<CFQUERY NAME="GetDetail">
select id, type, name
from activities
where activity_id = '#URL.ID#'
</CFQUERY>

Example: name = Doe, John


The CFSELECT:

<cfselect name="user" query="GetUsers" display="uname" value=uname" label="User Name:" queryPosition="below" selected="#GetDetail.name#"><option value="">Select a Name</option> </cfselect>

The problem is that the CFSELECT is deliminating by the comma and separating the first, last names into multiple fields which do not match the SELECT value.

I need to be able to format the names in this manner any suggestions on how to accomplish the use of the CFSELECT with a comma in the name?

Thanx
Mike
TOPICS
Advanced techniques

Views

511

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 07, 2006 Aug 07, 2006

Copy link to clipboard

Copied

select last_name+', '+first_name AS uname

seems to work ok

couldn't even get || ', ' || to work...? using msSQL2000

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2006 Aug 08, 2006

Copy link to clipboard

Copied

The bars "||" work fine in Oracle for concatenating two fields together in the SQL. The problem I am having is in displaying the field that has a comma in the data in the CFSELECT.
Thanx anyway.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 08, 2006 Aug 08, 2006

Copy link to clipboard

Copied

LATEST
try this....

use tilde "~" or something weird as deliminator in query
replace in select -option... don't know if will work in cfselect because the variable is not ##'ed

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 08, 2006 Aug 08, 2006

Copy link to clipboard

Copied

My suggestion is to not store the user's name in your activiities table. Store the user_id, instead. Then you can use the user_id field, which is hopefully numeric, in your cfselect and you won't have any problems with commas.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation