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

varchar & decimal in same field

Status
Not open for further replies.

nutrotek

Technical User
Aug 10, 2006
8
US
Hello,

I have data results in a SQL database. The results can either be <1 or a numeric decimal value such as 1.2 or 20.75. The <1 are stores in the field TextValue and the actual results are stored in the field LabValue. I download these results to Excel for calculations. My clients want the results stored in one Excel column "Results" where the results are <1, 1.2, 20.75 and they can perform calculations. If I concatinate these two fields SELECT TextValue+CAST(LabValue as VARCHAR(10)) from tblSampleTable, the resulting field is text and cannot be calculated in Excel. Is there a way I can combine the two, keeping the text field as varchar and the decimal field as decimal?
 
no there isn't.

why not replace <1 with -1 or something that will export to excel as a number though? Some numeric value that you are very certain will not appear in your data. You can then change these using conditional formatting or something.

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top