Changing Fields in table to Upper Case

AnnaVilj

New member
Local time
Yesterday, 19:53
Joined
Feb 16, 2007
Messages
3
Hi All, A quick question..

Is there a quick way to change about 5000 primary keys fields from lower case to uppercase?

Thanks Anna :)
 
Use this query:
UPDATE tblYourTable SET tblYourTable.YourField = UCase([YourField]);
 
anna

changing primary keys from lower to upper case wont matter as access ignores case, so thats not a problem. changing the value of a (keyed) text field is more significant, as any linked records would need updating also - which is ok if you use cascading updates, but personally i would prefer not to be changing keys everywhere

the fact that you are needing to change the keys indicates that this may happen?

the best procedure is to have a numeric key (autonumber) to act as the "true" key for the file, in which case the account number or whatever the text field represents can be changed to whatever you want

as a beneficial side effect, numeric keys work quicker than strings

if its not too late, i would consider this
 
Additionally, if it doesn't matter if the key is stored in upper case, meaning it just needs to be displayed in upper case, you can just display it that way:

Format(YourPrimaryKey,">")
 
I've found that the only time it matters if you have the data stored in upper/lower case, etc. is if you are letting users have direct access to the tables (which is a bad idea, and I recommend not letting them have direct access to them). If you always use forms for user interaction you can display it however you want and, if you really want, you can force the case issue there.
 

Users who are viewing this thread

Back
Top Bottom