473,414 Members | 1,626 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Type Conversion Error

When attempting an update query as follows.

Field: ROW_Cost_Acre
Table: Greene_County_Property
Update To: [ROW_Actual_Cost]\[ROW_Acres]

I get a type conversion error. It calculates the correct value for some of them but the other get a type conversion error. This same query works fine in another database for another county with no problem.

The query is calculating the cost per acre from the total cost field and the total acres field and then placing it in the cost per acre field.
Nov 4 '10 #1
8 2225
gnawoncents
214 100+
Lou,

Do you have any zeroes or nulls in your values? Also, what data type are you using for the three fields in question?
Nov 4 '10 #2
There are no Null values and all three fields are formatted as numbers. There are 21 total rows and the query works properly and updates 15 of those rows but returns the error on the remaining 6.
Nov 5 '10 #3
BRawn
28
Hi Lou,

Could you perhaps post the query you're trying to execute?
It'll give us a good idea of what you're trying to do and we can try and help you from there...
Nov 5 '10 #4
UPDATE Greene_County_Property SET Greene_County_Property.ROW_Cost_Foot = [ROW_Actual_Cost]\[ROW_Length], Greene_County_Property.ROW_Cost_Acre = [ROW_Actual_Cost]\[ROW_Acres]
WHERE ((([Greene_County_Property]![ROW_Aquired])="T" And ([Greene_County_Property]![ROW_Aquired])="T"));
Attached Images
File Type: jpg Doc1.jpg (23.2 KB, 165 views)
Nov 5 '10 #5
gnawoncents
214 100+
Kind of an odd question, but are any of your ROW_Acres 0.5 or less?
Nov 5 '10 #6
gnawoncents
214 100+
One other thing, is there any reason you're using the back-slash (\) for division as opposed to the forward-slash (/) for division? I ask because everything might just work fine if you switch to the forward-slash.
Nov 5 '10 #7
Yeah. It was the \ instead of /. I cant believe I overlooked something so stupid. Sorry to waste everyone's time.
Nov 5 '10 #8
OldBirdman
675 512MB
When I first read this post, I noticed the integer divide "\" and assumed this was what was wanted, as Cost-per-Acre might very well be expressed as a whole number of dollars. A quick check of Access Help revealed that both handled Null and Empty fields the same, So I didn't see the solution.
gnawoncents' question "...are any of your ROW_Acres 0.5 or less?" is the key. Access rounds each numeric expression BEFORE dividing. So 0.5 is rounded to 0, and the divide fails.
Some quick testing reveals some quirks, so I now know to be very careful with this operand or NOT USE IT at all. In Immediate Window:
Expand|Select|Wrap|Line Numbers
  1. ?5.7\2.2
  2.  3
  3. ?INT(5.7/2.2)
  4.  2
  5. ?FIX(5.7/2.2)
  6.  2
  7.  
  8. ?5.7\-2.2
  9.  -3
  10. ?INT(5.7/-2.2)
  11.  -3
  12. ?FIX(5.7/-2.2)
  13.  -2
Nov 5 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Smith John | last post by:
Here is my ASP.Net code "If CustomerCMD.Parameters("@Checkout").Value = 0 Then" Since I set the option strict on.... It is throwing type missmatch error. @Checkout is a "tinyinteger" in SQL...
1
by: tsar.omen | last post by:
Hello everyone, during my coding practice I have encounted the following problem: Vital code pieces: --- template <class T> class SmartPtr {
3
by: Bmack500 | last post by:
Hello all, and thank you in advance! The below code keeps giving me the error: Conversion from type 'Object()' to type 'Integer' is not valid. Do I need to do some casting or somethign? All...
1
by: Adam Porter | last post by:
First off, I've placed my very first webservice on the web and can access the .asmx file through my browser. Now, as I'm writing my Client App, I want to call these services. I'm getting a strange...
0
by: nithya176 | last post by:
Hey guys..i jus thought if u cud help me out wit this error im gettin. Im writing a c# code to create an add-in in visio using VSTO. I found this code which was in VB and i'm tryin to convert it to...
2
by: preeti13 | last post by:
i am tring to retrive the value form the data base but getting erorr i tried so many way but i didn't get the value i got the erorr like this: Implicit conversion from data type datetime to int is...
10
by: gilsygirl | last post by:
Hi Guys Season greetings to everyone. Does anyone have an idea to this error message. Thanks gilsygirl
4
by: shalskedar | last post by:
I want to transfer the excel data to th Db ..thru the VBA code. In the DB there is a table called outer2 containing 1 of the columns as "Upvc" whose format is set to Long integer. When i try to...
3
by: Arepi | last post by:
Hi, The following class decide which type is in the current instance and itialize depends on this information. The problem: When make an instance with any pointer type, a compilation error...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.