Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Union Help Msg 8114, Level 16, State 5, Line 1 Err

Author  Topic 

coastman14
Starting Member

1 Post

Posted - 2010-01-07 : 11:17:20
I am running a union query, that I have ran for 5 years with no problems, It runs for different counties, suddenly for one county it gives this error..I realize it is data but how can i be more specific as to where...

Server: Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to float.


select 1 as mlstype,1 as mls, prp.acres, prp.bathsfull as bathroom, prp.bathshalf, prp.bed1dim, prp.bed2dim, prp.bed3dim, prp.bed4dim, prp.bed5dim, prp.beds as bedrooms, prp.city as city, prp.county as other, prp.daysonmarket, prp.directions as description2, prp.garagecap as garage, prp.landsize, cast(prp.latitude as varchar(20)) as latitude, prp.legal, prp.listdate as entrydate, prp.listprice as price, prp.longitude, prp.lotdesc, prp.lotdim, lotsize, prp.mappage, prp.mlsnum, prp.officelist,prp.photocount as numberofpicts, prp.proptype as typeofunit, prp.realremarks, prp.remarks as description1, prp.restrictions, prp.schooldistrict as school, prp.schoolelem, prp.schoolhigh, prp.schooljunior, prp.streetaddress as address, prp.subdivision as title, prp.sqftbldg as sqft, prp.taxamount, prp.taxid, prp.yearbuilt, prp.zipcode, prp.DaysOnMarket as dom, ' ' as maplocation, prp.salepending, 'Houston' as markettable, 'http://picture.com/MediaDisplay/' + right(uri,2) + '/hr' + uri +'-50.jpg' as p50, '999-999-9999 x 110' as phone_number, '' as areas_title, 0 as agent, ' ' as soldadunndeal, prp.areas_id as areas_id, mls_office.officename as officename, mlsnum as lee2_id from prp join mls_office on prp.officelist=mls_office.officeid where mlsnum>0 and prp.county<> 'other' and (prp.county='Chambers' or prp.county='Chambers')

union

select 0 as mlstype,0 as mls, acres, bathroom, ' ' as bathshalf, ' ' as bed1dim, ' ' as bed2dim, ' ' as bed3dim, ' ' as bed4dim, ' ' as bed5dim, bedrooms, ' ' as city, other, ' ' as daysonmarket, description2, garage, ' ' as landsize, lee2.latitude, ' ' as legal, entrydate, price, lee2.longitude, ' ' as lotdesc, ' ' as lotdim, ' ' as lotsize, ' ' as mappage, mlsnum, 'MDUN01'as officelist, numberofpicts, typeofunit, ' ' as realremarks, description1, restrictions, lee2.school, ' ' as schoolelem, ' ' as schoolhigh, ' ' as schooljunior, address, areas.title as title, sqft, ' ' as taxamount, ' ' as taxid, yearbuilt, zipcode, dom, maplocation, salepending, 'Houston' as markettable, '999-999-9999' as phone_number, '' as areas_title, agent, soldadunndeal, lee2.areas_id, 'Officename' as officename, lee2_id from lee2 join areas on lee2.areas_id=areas.areas_id where soldadunndeal <> 1 and maplocation<>'With' and lee2.other='Chambers' order by price desc

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-07 : 11:25:16
seems like one of varchar fields which you're using as a float value is having some non numeric data.
Go to Top of Page
   

- Advertisement -