Solved

Convert integer to string

Posted on 2014-07-30
7
197 Views
Last Modified: 2014-07-31
Hi,

How can I convert from integer to string?

I have to convert this: 
#ToString(QSearchResult.ASABySecs)#  

This is integer in the database: QSearchResult.ASABySecs




<cfif isdefined('QSearchResult.ASABySecs')> 
<Cell ss:StyleID="Detail">
<Data ss:Type="String">#ToString(QSearchResult.ASABySecs)# </Data>
</Cell>
</cfif>

Open in new window


Thanks,
Lulu
0
Comment
Question by:lulu50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:rjohnsonjr
ID: 40230166
Looks great to me.

https://wikidocs.adobe.com/wiki/display/coldfusionen/ToString

Are you having an issue?
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 40230177
Excel will automatically interpret values in a cell as a number if they look like a number, but you had the correct command.   What is it doing that you don't like?

<Data ss:Type="String">
0
 

Author Comment

by:lulu50
ID: 40231408
Because the field is stored as a int but I have it exported to excel as string <Data ss:Type="String">

It gives me the yellow excel error.

Please take a look at the attached image.
0
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

Author Comment

by:lulu50
ID: 40231409
0
 
LVL 6

Accepted Solution

by:
rjohnsonjr earned 500 total points
ID: 40231455
I opened up excel created a document and saved it as an xml 2003 document.  I changed a column with a number in it to text and here was the generated xml:

  <Cell ss:StyleID="s62"><Data ss:Type="Number">2</Data></Cell>

Open in new window


This: ss:StyleID="s62"  on the cell is what makes the data appear as text and gets rid of the warning when you open the file.
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 40231546
It looks like you want to store it as a number then, not as text.    In your image, the "2" is text and asking you if you want to treat it as a number.   I would think you would want the 2 to be a number, yes?
0
 

Author Closing Comment

by:lulu50
ID: 40231868
Thanks,
0

Featured Post

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question