In search of a solution

donbettis

Old User Gone Astray
Local time
Today, 18:00
Joined
Jan 23, 2001
Messages
103
This is one of those that will most likely turn out to be easy but, I can’t for the life of me figure it out…

Here’s my problem…

In one column in one of my tables I have about 61 different numbers assorted throughout some 50000 records. What I need is an update query or something to change the 61 unique numbers into 61 unique words…

For Example;

100001 needs to become Blue
100002 needs to become Green
100003 needs to become Yellow

I can get an update query to update one unique number at a time but I need to be able to update all 61 numbers all at once… How might I go about doing this…?

Any and all help appreciated

Don :confused:
 
Last edited:
Create a function in a module for the 61 Words:-

Public Function InWord(Num As String) As String
Select Case Num
Case "100001"
InWord = "Blue"
Case "100002"
InWord = "Green"
Case "100003"
InWord = "Yellow"
...
...
Case Else
InWord = Num
End Select
End Function


Use the InWord() function in the Update Query:-

UPDATE yourTable SET NumberField=InWord(NumberField)
 
Thank you both for responding... I know have it fixed...

Don :D
 

Users who are viewing this thread

Back
Top Bottom