Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using concat function?

Status
Not open for further replies.

gtbikerider

Technical User
May 22, 2001
81
GB
I want my product_name to be displayed with a following hyphen. I thought the following code would work, but it causes an error. Any advise on how to do this?

#concat(product_Name, "-")#

--
John
 
if you're just displaying a - why not just do in the output, its just text..

<cfoutput query = "queryname">
#queryName.Product_name#-<br>
</cfoutput>

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Because I only want the hyphen to display when the variable is not "" and by doing it this way I save a load of CFIFs. That was the thinking anyway, but I think that was flawed.

--
John
 
gtbikerider, why would there be "loads of CFIFs"? It should only be one, like:

Code:
<cfif len(Product_name) gt 0>
  #Product_name# -
<cfelse>
  <!--- do nothing --->
</cfif>

Unless you have other variables at play here.....


____________________________________
Just Imagine.
 
Because I only want the hyphen to display when the variable is not "" and by doing it this way I save a load of CFIFs. That was the thinking anyway, but I think that was flawed.

you should be able to do that in the query with mySQL or MSSQL

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top