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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel cell formula

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB

Hi,

I'm trying to make an excel report using CF. I am using html tags within the report for layout purposes. When I output the telephone number in the report excel is dropping the leading 0 - if there is one, resulting in an incorrect number being output to the user. When i dump out the query it is fine, but doesn't work within excel. Does anyone know how I can force excel to output this leading 0? The data type for the field is a varchar and we are using SQL Server 2000, on MX 7 if that helps

TIA

Tony

 
excel is smart enough to try to determin what type of value is in the cell. If it can convert it to a number it will treat it as one. if the phone number was formatted like (xxx)xxx-xxxx it would treat it as a string. however if you have xxxxxxxxxx it will try to make it a number. You can force a excel to see a number as text by adding a ' to the beginning string. It will show in the value bar, but not the cell

<cfoutput>'#queryName.phoneNumber#</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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top