Solved

Convert integer to string

Posted on 2014-07-30
7
196 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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