Converting Packed Data

I

IrishRed

Hello All,
I have a table which has packed data in the dollar fields. For example the
price comes in as 124B which needs to be converted to 1242. A = 1, B = 2, C =
3, etc...

Is there a way to update the table to change the last bye of the field to
convert it from A to 1, B to 2, etc ? I know that I can do a simple find and
replace but I want to take the manual step out of the process.

Any suggestions?

Thanks for your time.
 
T

Tom van Stiphout

On Tue, 22 Apr 2008 16:40:00 -0700, IrishRed

Ceteram censeo the creator of that data should be flogged.

You can certainly write an update query, but I would create a new
field and write the interpreted value to it, leaving the old field
alone for everyone to loath.
update NewField
set NewField = Left$(OldField,Len(OldField)-1) &
Asc(Right$(OldField,1)-Asc("A")+1

-Tom.
 
I

IrishRed

Hi Tom,
Thank you for taking time to respond. I agree that he should be flogged. :)

Your suggestion did the trick. Thanks so much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top