Copy properties one field to another field with different field types

981
6
Jump to solution
01-30-2022 02:51 PM
turguttosun
New Contributor II

I have two different field with different properties as can be shown from photo. 

I need to copy one field  properties to another becaure there are more than 2000 rows.

When I try it gives error "The value is you entered is out of range or is not a whole number"

First field type is double second one is float. Thanks for answer.

 

1.jpg

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

If column2 needs to be long, then you will lose the decimals when the copy is made.

And you would have to do

int(column1) 

to do the rounding.  If it was float, then the decimal values would copy over unless there was an overflow caused by the reduction in field type.

Did you try any of the suggestions?


... sort of retired...

View solution in original post

6 Replies
DanPatterson
MVP Esteemed Contributor

Did you just try a simple field calculation such that yukseklik calculated using Elevation as the value field to use


... sort of retired...
JayantaPoddar
MVP Esteemed Contributor

As far as change of Field type of an existing field is concerned, you can't do it for a non-empty table.

You may delete the existing field (with NULL value), and create a new one with same name and the desired fieldtype.



Think Location
turguttosun
New Contributor II

 I need to copy column 1 to column 2.  I cant edit column 2 field type   it should be long type. 

0 Kudos
DanPatterson
MVP Esteemed Contributor

If column2 needs to be long, then you will lose the decimals when the copy is made.

And you would have to do

int(column1) 

to do the rounding.  If it was float, then the decimal values would copy over unless there was an overflow caused by the reduction in field type.

Did you try any of the suggestions?


... sort of retired...
turguttosun
New Contributor II

thank you for answer. I havent use before field calculator. As I know in order to copy one to another, both fielld type should be same.

 elevation(column 1) field type is  double

yukseklik(column 2) field type is long

 you wrote "int(column1)"   be used in  field calculator? thanks .

0 Kudos
turguttosun
New Contributor II

Thaks Dan,  I tried just before it works!

0 Kudos