Make 1 field into 2

  • Thread starter Thread starter Karin
  • Start date Start date
K

Karin

Hi,
I have a single table with IDClient (which is primary key), it has decimal
points up to 5. I want to take the decimals and move them into their own
field named IDEng.
If the decimal is 0, I need a 0. I'm drawing a complete blank. It might
be best to end up with and extra field: IDClient (remains unchanged),
IDClient2 (has main numbers) and IDEng (has decimals) (just in case I screw
up). TIA!
 
Hi,
I have a single table with IDClient (which is primary key), it has decimal
points up to 5.  I want to take the decimals and move them into their own
field named IDEng.
If the decimal is 0, I need a 0.  I'm drawing a complete blank.   It might
be best to end up with and extra field: IDClient (remains unchanged),
IDClient2 (has main numbers) and IDEng (has decimals) (just in case I screw
up). TIA!

You can use the Fix function to get the whole number portion.

Fix(9.553) = 9

So if you subtract that from your original number, you'll have the
decimal portion.

v = 9.553
whole = Fix(v) ' = 9
decimal = v - Fix(v) ' = .553

Keven Denen
 
You can use the Fix function to get the whole number portion.

Fix(9.553) = 9

So if you subtract that from your original number, you'll have the
decimal portion.

v = 9.553
whole = Fix(v)  ' = 9
decimal = v - Fix(v) ' = .553

Keven Denen

Ooo...one potential issue. You'll probably want to convert the fix(v)
to a decimal to avoid round off errors.

decimal = v - CDec(Fix(v))

Keven Denen
 
Back
Top