Solved

Convert integer to string

Posted on 2014-07-30
7
192 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
  • 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now