25 pts.
 MS Access 2003 replacing a text string in a table with a specific number
I am using MS Access 2003. I have two text strings, "no avail" and "not available", and empty data boxes in a table. I need to replace the "no avail" and "not available" strings with the number "-5" and the empty data boxes with "-1". Is there a way to do this in a table or a query? Also, the table that this data is in is linked. Any help you can provide will be greatly appreciated. Thank you. Silvia

Software/Hardware used:
ASKED: December 24, 2008  5:56 PM
UPDATED: December 31, 2008  5:28 PM

Answer Wiki:
Just use an UPDATE QUERY. <a href="http://599cd.com/tips/access/update-query?key=ITKnowledgeExchange">Here's a tutorial</a>
Last Wiki Answer Submitted:  December 26, 2008  2:29 pm  by  Amicron   15 pts.
All Answer Wiki Contributors:  Amicron   15 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hello,

I don’t know the answer to this question in code but the logic should go something like this:
You should try to make the strings “not available” and “no avail” into String variables and then set them with something like Set a = “not available” to Set a = -1 & “”. I thing this should work. However if you are trying to make a string into an integer this will never work. Good Luck

Jan

 30 pts.

 

update <tablename> set <columntobeupdated> = ‘-5′ where <columntobeupdated> = ‘no avail’ or where <columntobeupdated>=’not available’

update <tablename> set <columntobeupdated> = ‘-1′ where <columntobeupdated> is null

 350 pts.