Update first number.

  • Thread starter turks67 via AccessMonster.com
  • Start date
T

turks67 via AccessMonster.com

Is it possible to update the first number only in a field?
eg 1.75 to 13.75

I would like to change the 1 to 13.

Thanks
 
J

John Spencer

Add 12 to the number if it is a number field.

UPDATE SomeTable
SET SomeField = SomeField + 12
WHERE SomeField = 1.75

Just replace the value
UPDATE SomeTable
SET Somefield = 13.75
WHERE SomeField = 1.75

If the field is text
UPDATE SomeTable
SET Somefield = "13.75"
WHERE SomeField = "1.75"

This is so simple, that obviously you must have something more complex
that just changing 1.75 to 13.75. However, from your stated question
there is really no good way to know what you want to do in a more
general sense.

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

turks67 via AccessMonster.com

Thanks, but there is something I'm doing wrong.

John said:
Add 12 to the number if it is a number field.

UPDATE SomeTable
SET SomeField = SomeField + 12
WHERE SomeField = 1.75

Just replace the value
UPDATE SomeTable
SET Somefield = 13.75
WHERE SomeField = 1.75

If the field is text
UPDATE SomeTable
SET Somefield = "13.75"
WHERE SomeField = "1.75"

This is so simple, that obviously you must have something more complex
that just changing 1.75 to 13.75. However, from your stated question
there is really no good way to know what you want to do in a more
general sense.

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

John Spencer

Would you care to share a little more about your problem? Your
responses are terse and lack information on what you have tried and what
has failed and on how your efforts have failed.

Good luck and may you solve your problems.

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

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