Solved

Convert integer to string

Posted on 2014-07-30
7
194 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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