Update Query - Convert % to Number Format

C

Curtis Stevens

I have an update query that updates the info in a particular table. One
field I'm updating is a field with a % in it, like 70%. There will be
multiple % found in all the records, some records will have 60%, some will
have 70%.

I simply can't put "0.6" for example in the update query field as it wont
apply to all records. What do I put in that particular field of the update
query to make the approperiate change, so it takes whatever % is in the
particular record and changes it to this format "0.7" or "0.6."

Thanks
Curtis
 
J

Jeff Boyce

Curtis

Perhaps you don't need to 'convert' the value at all...

Would it be sufficient to change the format it is displayed in?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
C

Curtis Stevens

I have tried that. I'm copying data from excel and it is in 60% format from
Excel. So I need to paste it into my table and it come out as 0.6. When I
tried different formats for that field for the table, nothing works right.
Why I have a query that updates that field and a few others for that table
after I paste the info. The other updates moves stuff around, adds fileds
together, etc.
 
J

John Spencer

Use the expression
Val(SomeField)/100

UPDATE SomeTable
SET SomeField = Val([SomeOtherField])/100
WHERE SomeOtherField is Not Null

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
C

Curtis Stevens

Thanks, that did it!
Use the expression
Val(SomeField)/100

UPDATE SomeTable
SET SomeField = Val([SomeOtherField])/100
WHERE SomeOtherField is Not Null

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Curtis said:
I have an update query that updates the info in a particular table. One
field I'm updating is a field with a % in it, like 70%. There will be
multiple % found in all the records, some records will have 60%, some will
have 70%.

I simply can't put "0.6" for example in the update query field as it wont
apply to all records. What do I put in that particular field of the update
query to make the approperiate change, so it takes whatever % is in the
particular record and changes it to this format "0.7" or "0.6."

Thanks
Curtis
 

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