Error Converting Data Type Varchar to Float (Professional)

<< Click to Display Table of Contents >>

Navigation:  Professional > Troubleshooting > Reporting Errors >

Error Converting Data Type Varchar to Float (Professional)

Affected Software/Reports/DLL(s): EQuIS Professional

Affected Software Version: N/A

Symptoms: The following error can occur when running a report through EQuIS Professional:

 

Error converting data type varchar to float.

 

Cause/Details: This error is caused by non-numeric data in a field that the report expects to be numeric. Fields with the varchar data type are designed to hold any character type, but for purposes of functions such as unit conversions or action level comparisons, numeric data is required.

 

Resolution/Workaround: Identify this data and alter it so that either:

 

a.The data is numeric, or

b.the report will ignore this data (such as by setting the data to be non-reportable in the REPORTABLE_YN field).

 

If the data already appears to be numeric, extra spaces or carriage breaks may be present in the field. Clear the field and reenter the data manually to eliminate these additional characters.

 

There are two Views in the EQuIS Database that can help identify data that may lead to this error:

 

VW_COORD_NON_NUMERIC and

VW_RESULT_NON_NUMERIC

 

These views will show the records in DT_COORDINATE and DT_RESULT, respectively, where non-numeric data has been found. Note that certain data (e.g. latitude and longitude coordinates in non-decimal degrees or results for color) might be intended to stay non-numeric.

 

If neither of the above two views shows any records, check DT_COORD.ELEV. If a database administrator has SQL Server Management Studio (SSMS) access, have them try the following query that should identify any DT_COORDINATE records where the ELEV field contains non-numeric data.

 

SELECT * from DT_COORDINATE where elev is not null and try_cast(elev as float) is null.